Using consId from an API call within a s-tag
Example: [[S48:2647-" + this.consId + ":cons.custom_string13]]
This does not seem to be working. Is this possible? What am I missing?
A bit more information about what we are trying to do:
Within the participant center we want to display the team roster to team captains which includes the team member's name and their selected t-shirt size (chosen during registration).
We've discovered that we can create this list of team members using the getParticipants API call and filter by team_name.
We've also discovered that we can grab the participants response to t-shirt size which is stored on their constituent record using [[S48:2647-5312121:cons.custom_string13]]
But we are unable to dynamically pull in the consId for each participant in the list.
Here's a peek at the code we are using:
<script type="text/javascript">
jQuery(document).ready(function()
{
getRoster();
});
function getRoster(){
jQuery("#results").html("<p>Loading...</p>");
var requestString =
'https://secure3.convio.net/****/site/CRTeamraiserAPI?' +
'method=getParticipants' +
'&v=1.0' +
'&api_key=****' +
'&response_format=json' +
'&suppress_response_codes=true' +
//'&fr_id=[[S80:trID]]' +
'&fr_id=****' +
'&list_sort_column=last_name' +
'&list_ascending=true' +
'&team_name=****' +
'&first_name=%%%';
var requestURL = "AjaxProxy?auth=[[S86:true]]&cnv_url=" + escape(requestString);
jQuery.getJSON(requestURL,function(data)
{
if(data.errorResponse)
{
jQuery("#results").html("<p>(" + data.errorResponse.message + ")</p>");
} else {
jQuery("#results").html("");
var trObject=data.getParticipantsResponse.participant;
jQuery.each(trObject,function()
{
var memID = this.consId;
jQuery("#results").append("<p><strong>Name:</strong> " + this.name.first + " " + this.name.last + " <strong>ConsID:</strong> " + this.consId + " <strong>T-Shirt Size:</strong> [[S48:2647-" + this.consId + ":cons.custom_string13]] || TESTING [[S48:2647-5312121:cons.custom_string13]] || TESTING 2:" + memID +" </p>");
});
}
});
};
</script>
[[S48:2647-5312121:cons.custom_string13]]
<div id="results"></div>
***I've hidden the shortname, API key and a few other pieces - but they are there on the live test***
Any help would be greatly appreciated!

@NoahCooper
Comments
-
That won't work because S tag is a server-side while the API is a REST based API that is a client-side (i.e. Javascript).
Server side always get processed first before the client-side, thus it never would make it in time to retrieve the returned API result. However, for general note -- the other direction would work meaning you could hold S-tag value in a Javascript variable -- that will work.
Haven't read all the details on your posting just yet-- but I was wondering why not retrieving cons ID through S1 tag? you could do that instead of doing it through API especially if you are looking for a logged in user cons ID. When you nest multiple S tag, make sure that you use E on the outer S-tag so in your example that would look in this fashion below:
[[E48:2647-[[S1:cons_id]]:cons.custom_string13]]
regards,
DanielKate Gollogly:
I'm trying to use the consId I've retrieved from an API call within a s-tag.
Example: [[S48:2647-" + this.consId + ":cons.custom_string13]]
This does not seem to be working. Is this possible? What am I missing?1 -
You are using getParticipants. That method can return the consId.
But I don't think you can get a custom cons field using getParticipants, or any other method, for anyone but yourself.
<getParticipantsResponse xsi:schemaLocation="http://convio.com/crm/v1.0 http://service.convio.net/xmlschema/crm.public.v1.xsd" xmlns="http://convio.com/crm/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<totalNumberResults>3</totalNumberResults>
<participant>
<name>
<first>Participant</first>
<last>Sample01</last>
</name>
<aTeamCaptain>false</aTeamCaptain>
<teamName/>
<donationUrl>http://example.com/donateurl</donationUrl>
<personalPageUrl>http://example.com/personalpageurl</personalPageUrl>
<teamPageUrl/>
<consId>1001000</consId>
<personalPagePrivate>false</personalPagePrivate>
<amountRaised>5180</amountRaised>
<goal>105060</goal>
<eventName>Event 1000</eventName>
<eventId>1000</eventId>
</participant>
One idea is to put the collection of team member cons Ids (getTeamMembers might be faster for this) into an array and then populating each row in your results from a JSONP call to a "roll-your-own-API". Noah wrote a blog post about this once a long ways back. The basic idea is that you build a PageBuilder page which serves up nothing but some JSON (so you'll need to add the url param to turn off the wrapper when you make a call the 'API'.) That PB page populates the data by using the cons id that you pass to it via a query string param in the calling URL. Just don't serve anything sensitive, cause there isn't any security here.
So the request url would look like this as you walked through the array of team member ids.
var requestURL = "https://secure3.convio.net/ABC/site/SPageServer?pagename=JSONPTest&consid=" + myConsIdList[index] + "&printer_friendly=1";
And each call would return a page of JSON from a PB page coded like this:
{
"screenname" : [[E48:2647-[[S334:consid]]:screenname]];
"shirtSize" : [[E48:2647-[[S334:consid]]:cons.custom_string13]];
}
Then append each result to your roster.
Hope that makes sense!
-B
EDIT: clarity1 -
Ok as I read further what you are trying to achieve, here are some steps / ideas you may try -- you may probably need two pagebuilders at minimum and also depending on how you are presenting the Participant Center 2 (PC2) -- this note is assuming that you have a PC2 as a stand alone (not an embedded through iframe as result of that S409 tag)
1. ) Get the team-id through S48. Put this into a pagebuilder -- this pagebuilder be included/loaded to your Participant Center (i.e. through jQuery load) and when a team captain logs into his/her PC2, that page would surely return the team ID.
Note the use of S334 to dynamically retrieve the FR_ID from the fr_id URL parameter that always get returned within the Participant Center 2 URL also note why I put that inside of the DIV, so that we could target that DIV to retrieve the content on subsequent steps below
<div id="myTeamID">[[E48:[[S334:fr_id]]-[[S1:cons_id]]:team-id]]</div>
2.) Retrieve the text value of that DIV above and Assign the Team ID value you retrieved above to a Javascript variable to be used for filter to the API call of
getTeamMembers API
http://open.convio.com/api/#teamraiser_api.getTeamMembers_method.html.
This API would return those team members saving the effort from having to do extra team name filtering, most importantly it returns the cons_id
3.) Knowing that client side variables can't be passed for processing at server-side as I mentioned earlier, one of the workaround you could alternatively use -- you might want to use a pagebuilder as placeholder to be called / load (i.e. through jQuery load to load and append into a DIV placeholder x amount of times reflecting the returned records of the above API call, where you could pass the API returned cons ID, first name, last name into / as URL parameters to be appended into that pagebuilder URL. And the content of that pagebuilder is that full set of S-tags
<h1>Team Member</h1>
<p>First Name: [[S334:tmfname]]</p>
<p>Last Name: [[S334:tmlname]]</p>
<p>T-shirt size:[[E48:[[S334:fr_id]]-[[S334:cid]]:cons_custom_string13]]</p>
note feel free to change the parameter name to your own if you don't want to keep what's given above, in that above, the tmfname is to hold returned API first name, tmlname is to hold returned API last name, and the cid is to hold your returned cons ID from the API
Hope it helps,
DanielDaniel Hartanto:
That won't work because S tag is a server-side while the API is a REST based API that is a client-side (i.e. Javascript).
Server side always get processed first before the client-side, thus it never would make it in time to retrieve the returned API result. However, for general note -- the other direction would work meaning you could hold S-tag value in a Javascript variable -- that will work.
Haven't read all the details on your posting just yet-- but I was wondering why not retrieving cons ID through S1 tag? you could do that instead of doing it through API especially if you are looking for a logged in user cons ID. When you nest multiple S tag, make sure that you use E on the outer S-tag so in your example that would look in this fashion below:
[[E48:2647-[[S1:cons_id]]:cons.custom_string13]]
regards,
DanielKate Gollogly:
I'm trying to use the consId I've retrieved from an API call within a s-tag.
Example: [[S48:2647-" + this.consId + ":cons.custom_string13]]
This does not seem to be working. Is this possible? What am I missing?0 -
LOL - great minds.
- B1 -
two heads are better than one as the saying goes otherwise just killing off some down times at lunch as if there isn't much to do ha
) Happy Thursday there B!
Brian Mucha:
LOL - great minds.
- B0 -
Note that there is an undocumented Content API method called render which can evaluate S-Tags.
https://secure3.convio.net/myorg/site/CRContentAPI?v=1.0&api_key=MyKey&method=render&content=[[S42:1234:title]]&auth=token
With luminateExtend, this looks like:
luminateExtend.api({
api: 'content',
data: 'method=render&content=[[S42:1234:title]]',
requiresAuth: true
})
Keep in mind that if you're putting this content into a page that runs through the Luminate Online template engine, you must use L-Tags to avoid the S-Tag being evaluated, e.g.
luminateExtend.api({
api: 'content',
data: 'method=render&content=[[LL]]S42:1234:title[[LR]]',
requiresAuth: true
})4 -
Wow! That is going to be a post we come back to a lot in the future, Noah. Thanks!!0
-
Thanks Noah for this -- bookmarked as this would make life much simpler onward.
Noah Cooper:
Note that there is an undocumented Content API method called render which can evaluate S-Tags.
https://secure3.convio.net/myorg/site/CRContentAPI?v=1.0&api_key=MyKey&method=render&content=[[S42:1234:title]]&auth=token
With luminateExtend, this looks like:
luminateExtend.api({
api: 'content',
data: 'method=render&content=[[S42:1234:title]]',
requiresAuth: true
})
Keep in mind that if you're putting this content into a page that runs through the Luminate Online template engine, you must use L-Tags to avoid the S-Tag being evaluated, e.g.
luminateExtend.api({
api: 'content',
data: 'method=render&content=[[LL]]S42:1234:title[[LR]]',
requiresAuth: true
})0 -
Thanks for the reply!
@NoahCooper Where might I be able to find some documentation on these undocumented methods (the irony behind that question lol) and L-tags? Any point of reference to work of would be great!
Thanks all for your contribution to this! We'll be sure to share what we come up with.
Noah Cooper:
Note that there is an undocumented Content API method called render which can evaluate S-Tags.
https://secure3.convio.net/myorg/site/CRContentAPI?v=1.0&api_key=MyKey&method=render&content=[[S42:1234:title]]&auth=token
With luminateExtend, this looks like:
luminateExtend.api({
api: 'content',
data: 'method=render&content=[[S42:1234:title]]',
requiresAuth: true
})
Keep in mind that if you're putting this content into a page that runs through the Luminate Online template engine, you must use L-Tags to avoid the S-Tag being evaluated, e.g.
luminateExtend.api({
api: 'content',
data: 'method=render&content=[[LL]]S42:1234:title[[LR]]',
requiresAuth: true
})1 -
Good news is we got it working within a page builder page!
http://cibcrunforthecure.supportcbcf.com/site/PageNavigator/TEST_team_roster_api.html
But we are now tying to pull this code into the participant center so that team captains can find this information within their pc.
This has brought about another slew of errors as the pc does not seem to work well with Luminate Extend.
@NoahCooper, is there a trick to getting Lumiante Extend to work in the participant center?0
Categories
- All Categories
- Shannon parent
- shannon 2
- shannon 1
- 21 Advocacy DC Users Group
- 14 BBCRM PAG Discussions
- 89 High Education Program Advisory Group (HE PAG)
- 28 Luminate CRM DC Users Group
- 8 DC Luminate CRM Users Group
- Luminate PAG
- 5.9K Blackbaud Altru®
- 58 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 409 bbcon®
- 2.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- donorCentrics®
- 1.1K Blackbaud eTapestry®
- 2.8K Blackbaud Financial Edge NXT®
- 1.1K Blackbaud Grantmaking™
- 527 Education Management Solutions for Higher Education
- 1 JustGiving® from Blackbaud®
- 4.6K Education Management Solutions for K-12 Schools
- Blackbaud Luminate Online & Blackbaud TeamRaiser
- 16.4K Blackbaud Raiser's Edge NXT®
- 4.1K SKY Developer
- 547 ResearchPoint™
- 151 Blackbaud Tuition Management™
- 61 everydayhero
- 3 Campaign Ideas
- 58 General Discussion
- 115 Blackbaud ID
- 87 K-12 Blackbaud ID
- 6 Admin Console
- 949 Organizational Best Practices
- 353 The Tap (Just for Fun)
- 235 Blackbaud Community Feedback Forum
- 55 Admissions Event Management EAP
- 18 MobilePay Terminal + BBID Canada EAP
- 36 EAP for New Email Campaigns Experience in Blackbaud Luminate Online®
- 109 EAP for 360 Student Profile in Blackbaud Student Information System
- 41 EAP for Assessment Builder in Blackbaud Learning Management System™
- 9 Technical Preview for SKY API for Blackbaud CRM™ and Blackbaud Altru®
- 55 Community Advisory Group
- 46 Blackbaud Community Ideas
- 26 Blackbaud Community Challenges
- 7 Security Testing Forum
- 3 Blackbaud Staff Discussions
- 1 Blackbaud Partners Discussions
- 1 Blackbaud Giving Search™
- 35 EAP Student Assignment Details and Assignment Center
- 39 EAP Core - Roles and Tasks
- 59 Blackbaud Community All-Stars Discussions
- 20 Blackbaud Raiser's Edge NXT® Online Giving EAP
- Diocesan Blackbaud Raiser’s Edge NXT® User’s Group
- 2 Blackbaud Consultant’s Community
- 43 End of Term Grade Entry EAP
- 92 EAP for Query in Blackbaud Raiser's Edge NXT®
- 38 Standard Reports for Blackbaud Raiser's Edge NXT® EAP
- 12 Payments Assistant for Blackbaud Financial Edge NXT® EAP
- 6 Ask an All Star (Austen Brown)
- 8 Ask an All-Star Alex Wong (Blackbaud Raiser's Edge NXT®)
- 1 Ask an All-Star Alex Wong (Blackbaud Financial Edge NXT®)
- 6 Ask an All-Star (Christine Robertson)
- 21 Ask an Expert (Anthony Gallo)
- Blackbaud Francophone Group
- 22 Ask an Expert (David Springer)
- 4 Raiser's Edge NXT PowerUp Challenge #1 (Query)
- 6 Ask an All-Star Sunshine Reinken Watson and Carlene Johnson
- 4 Raiser's Edge NXT PowerUp Challenge: Events
- 14 Ask an All-Star (Elizabeth Johnson)
- 7 Ask an Expert (Stephen Churchill)
- 2025 ARCHIVED FORUM POSTS
- 322 ARCHIVED | Financial Edge® Tips and Tricks
- 164 ARCHIVED | Raiser's Edge® Blog
- 300 ARCHIVED | Raiser's Edge® Blog
- 441 ARCHIVED | Blackbaud Altru® Tips and Tricks
- 66 ARCHIVED | Blackbaud NetCommunity™ Blog
- 211 ARCHIVED | Blackbaud Target Analytics® Tips and Tricks
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- Luminate CRM DC Users Group
- 225 ARCHIVED | Blackbaud eTapestry® Tips and Tricks
- 1 Blackbaud eTapestry® Know How Blog
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
- 1 Blackbaud K-12 Education Solutions™ Blog
- 280 ARCHIVED | Mixed Community Announcements
- 3 ARCHIVED | Blackbaud Corporations™ & Blackbaud Foundations™ Hosting Status
- 1 npEngage
- 24 ARCHIVED | K-12 Announcements
- 15 ARCHIVED | FIMS Host*Net Hosting Status
- 23 ARCHIVED | Blackbaud Outcomes & Online Applications (IGAM) Hosting Status
- 22 ARCHIVED | Blackbaud DonorCentral Hosting Status
- 14 ARCHIVED | Blackbaud Grantmaking™ UK Hosting Status
- 117 ARCHIVED | Blackbaud CRM™ and Blackbaud Internet Solutions™ Announcements
- 50 Blackbaud NetCommunity™ Blog
- 169 ARCHIVED | Blackbaud Grantmaking™ Tips and Tricks
- Advocacy DC Users Group
- 718 Community News
- Blackbaud Altru® Hosting Status
- 104 ARCHIVED | Member Spotlight
- 145 ARCHIVED | Hosting Blog
- 149 JustGiving® from Blackbaud® Blog
- 97 ARCHIVED | bbcon® Blogs
- 19 ARCHIVED | Blackbaud Luminate CRM™ Announcements
- 161 Luminate Advocacy News
- 187 Organizational Best Practices Blog
- 67 everydayhero Blog
- 52 Blackbaud SKY® Reporting Announcements
- 17 ARCHIVED | Blackbaud SKY® Reporting for K-12 Announcements
- 3 Luminate Online Product Advisory Group (LO PAG)
- 81 ARCHIVED | JustGiving® from Blackbaud® Tips and Tricks
- 1 ARCHIVED | K-12 Conference Blog
- Blackbaud Church Management™ Announcements
- ARCHIVED | Blackbaud Award Management™ and Blackbaud Stewardship Management™ Announcements
- 1 Blackbaud Peer-to-Peer Fundraising™, Powered by JustGiving® Blogs
- 39 Tips, Tricks, and Timesavers!
- 56 Blackbaud Church Management™ Resources
- 154 Blackbaud Church Management™ Announcements
- 1 ARCHIVED | Blackbaud Church Management™ Tips and Tricks
- 11 ARCHIVED | Blackbaud Higher Education Solutions™ Announcements
- 7 ARCHIVED | Blackbaud Guided Fundraising™ Blog
- 2 Blackbaud Fundraiser Performance Management™ Blog
- 9 Foundations Events and Content
- 14 ARCHIVED | Blog Posts
- 2 ARCHIVED | Blackbaud FIMS™ Announcement and Tips
- 59 Blackbaud Partner Announcements
- 10 ARCHIVED | Blackbaud Impact Edge™ EAP Blogs
- 1 Community Help Blogs
- Diocesan Blackbaud Raiser’s Edge NXT® Users' Group
- Blackbaud Consultant’s Community
- Blackbaud Francophone Group
- 1 BLOG ARCHIVE CATEGORY
- Blackbaud Community™ Discussions
- 8.3K Blackbaud Luminate Online® & Blackbaud TeamRaiser® Discussions
- 5.7K Jobs Board