TeamRaiser Registration Questions - display possible answers based on other team members

Options
Hi there, 


We have an event with the following set up: 
  • We have an event with teams of 5 people. 
  • Each team is assigned to a bike and each person rides the bike for one hour. 
  • During registration, we would like to have each person choose the hour that they would like to ride. Only available hours would display. 
Any fancy ideas on how we might be able to achieve this? I would think that since the captain goes first, they will choose out of any of the 5 hours - then I would think that we could use an API on the registration page to pull the answers from the other team members and - then cross out the options. 


Thanks!

Hilary 

 
Tagged:

Comments

  • Hilary Engelbrecht:

    Hi there, 


    We have an event with the following set up: 

    • We have an event with teams of 5 people. 
    • Each team is assigned to a bike and each person rides the bike for one hour. 
    • During registration, we would like to have each person choose the hour that they would like to ride. Only available hours would display. 
    Any fancy ideas on how we might be able to achieve this? I would think that since the captain goes first, they will choose out of any of the 5 hours - then I would think that we could use an API on the registration page to pull the answers from the other team members and - then cross out the options. 


    Thanks!

    Hilary


    The problem with that idea is that the getRegistration method requires authentication - you can only retrieve registration question answers for yourself unless you are an admin.


    I wonder about using ecommerce upsells. ECom products can have an inventory and can be free. So when the 'product' for your timeslot sells out it would disappear.

  • Hmm. The problem with the upsell idea is that I assume you don't know the teams beforehand, so how are the products premade?


    Another idea is to use a survey. With a survey, you could have a TEAMNAME field that is a select populated from an API call. You CAN get all the current team names.


    But that just shifts the lump. How do you populate the hour slot field? The survey S28 tag with the reporting parameter only returns the first 5 answers. You just don't have a data store in Luminate for this that you can also read from. Man, I wish BB would add to the APIs! The always seem half done.


    FormStack has a Rest API that you can get survey answers from. That way you could get all the taken slots for each team and populate the select with the left over choices.


    https://developers.formstack.com/v2.0/docs/form-id-submission-get
  • I think you can make a couple of API calls to achieve this. First one, to get team members and the second, to get all answers together "comma separated"


    Assuming you are using LuminateExtend, here is a sample code (replace yellow highlights with your values):

     

    luminateExtend.api({
      api: 'teamraiser',
      data: 'method=getTeamMembers&fr_id=<FR_ID>&team_id=<TEAM_ID>',
      callback: {
        success: function(response) {
          var content = "";
          var members = luminateExtend.utils.ensureArray(response.getTeamMembersResponse.member);
          $.each(members, function(idx) {
            content += "[[S48:<FR_ID>-" + this.consId + ":question:<your TR question>]]" + (idx < members.length - 1 ? "," : "");
          });
          luminateExtend.api({
            api: 'content',
            data: 'method=render&content=' + content,
            requiresAuth: true,
            callback: {
              success: function(response) {
                var answers = response.renderResponse.content;
                // Build your drop-down with available hours here...
              }
            }
          })
        }
      }
    })

  • content.render


    Oh, that's pretty cool. I forgot all about that undocumented method. Nice one, Rom.

Categories