I'm an image
I'm an image
I'm an image

When checking attendees into events, it can often be helpful to have a quick view of placement groups, required signature document statuses, and payment information. It's helpful to volunteers doing check-in to quickly see red flags to pass issues off to a staff member.

 

This can be achieved by using the Success Template on a check in configuration, and made more flexible by adding some lava attributes to groups and group types. This will allow us to change the Success Template message on a per group or per group type basis. 

Step 1: Group Type Attribute

  • Navigate to the Entity Attributes Page (System Settings > Entity Attributes) and change the Entity Type to Group Type
  • Add a new Group Type attribute for Check-In Success Template.

Step 2: Check-In Configuration

  • Navigate to the Check In Configuration page for the configuration you will be using for check in (this could be done on all of them if you want this functionality on all configurations). Click Edit to edit the configuration and then open the Display Settings.
  • Change the Success Template Display Mode to Append.
  • Replace the content of the Success Template (if there is any) with the lava shown below and in the screenshot. Make sure that your Group Type Check-In Success Template attribute Key matches what you used when you created the attribute.
  • Save the configuration



Success Template for Check-In Configuration

{% for checkinResult in CheckinResultList %}
    {% assign personId = checkinResult.Person.Id %}
    {% assign groupTypeId = checkinResult.Group.GroupTypeId %}
    {% assign groupId = checkinResult.Group.Id %}
    {% assign group = groupId | GroupById %}
    {% assign groupTemplate = group | Attribute:'CheckInSuccessTemplate','RawValue' %}
    {% grouptype id:'{{ groupTypeId }}' %}
        {% assign typeTemplate = grouptype | Attribute:'CheckInSuccessTemplate','RawValue' %}
        {% if groupTemplate !=empty %}
            {% comment %}If the group has its own template we'll use that.{% endcomment %}
            {% assign template = groupTemplate %}
        {% elseif typeTemplate !=empty %}
            {% comment %}If the group does not have a template, we'll get the one from the group type.{% endcomment %}
            {% assign template = typeTemplate %}
        {% endif %}
        {{ template | RunLava }}
    {% endgrouptype %}
{% endfor %}

Step 3: Group Type Configuration

  • Navigate to the Group Type that you're using for check in. If you have multiple, you can do this for each of them.
  • You will now see a "Check-In Success Template" attribute. Anything you put here will show as the success message during check in for all groups of this type.
  • Under Group Attributes, add a new attribute. It should be identical to the entity attribute you created for group types. Primarily setting it to Lava and having the key match are important. This will allow us to set group-specific check in success messages that override the group type and configuration message.
  • Under the Group Type Display Options, we need to modify the lava to exclude the template from displaying with group information on the group view page. A sample of how to do that is shown in the screenshot. Be sure that the attribute key matches what you created.

We'll go over setting the actual template values in a later step.

Step 4: Creating Lava Templates

The steps below will be a sample based on what we did for kids and student camps check in. This entire step could be changed to just about anything else, it's just meant to show one way to create a lava template for this.

Now that you've created attributes on both the individual groups and on the entire group type, you can set the template from either place. Templates set on the group override whatever you set on the group type. This can be helpful if you need different messages for kids camp vs middle school or high school camp.

For this example, we're going to be setting the template on the specific group, using the middle school camp registration linkage group as an example.

  • If you haven't already followed the Lava Shortcode for Placement Groups on Check In recipe to create a lava shortcode for placement groups, do that now.
  • Navigate to your camp main event group. The group type should be set up as we did above so that one of the group attributes is the Check-In Success Template lava field.
  • The group should also be the group that you will actually be checking students into for camp, so that the message will show on check-in.
  • The code shown below is the Check-In Success Template attribute value for our Middle School camp group. It looks intimidating so I'll walk through it.
    • The first section of code captures the group name (or names) of each type of group - bus, cabin, team, and small group. If you haven't read the lava shortcode recipe, this won't make any sense.
    • The sql query is used for returning registrations that a person is part of when provided with registration instance ids. In this case we gave it 3 ids - one for student, one for adult volunteer, and one for minor volunteer since we have a separate registration instance for each. We could have just set this to the student instance since that's the group we're using anyway, but we wanted to be able to use this same lava on the other two check in groups also.
    • Beneath the sql query we're checking the balance due on the registrations and the status of the applicable signature documents.  We're then capturing either a green span or a red span with information depending on the results of each.
    • In the main div, we have essentially the same or similar code 6 times. We're showing the captured spans for balance and signature documents, and then doing the same for each of the types of groups we set at the top.
  • The result is the check in success screen shown in the images.

Success Template for MS Camp Group

{% comment%}Middle School Camp Template{% endcomment%}
{% capture bus %}{[ memberofgroups parentgroupid:'1001798' personid:'{{ personId }}' groupterm:'' comment:'Middle School Bus' ]}{% endcapture%}
{% capture cabin %}{[ memberofgroups parentgroupid:'1001799' personid:'{{ personId }}' groupterm:'Cabin' comment:'Middle School Cabin' ]}{% endcapture%}
{% capture team %}{[ memberofgroups parentgroupid:'1003368' personid:'{{ personId }}' groupterm:'Team' comment:'Middle School Team' ]}{% endcapture%}
{% capture smallgroup %}{[ memberofgroups parentgroupid:'1001793' personid:'{{ personId }}' groupterm:'Group' comment:'Middle School Small Group' showleader:'True' ]}{% endcapture%}
{% comment %}Instance that a person could be part of should be set in the query below. This includes instances for anyone who will be using this template to check in, so could be participant, volunteer, and youth volunteer, etc.{% endcomment %}
{% sql personId:'{{ personId }}' %}
    SELECT pa.PersonId, rr.RegistrationId, ri.Name AS InstanceName, sd.*
    FROM PersonAlias pa
    JOIN RegistrationRegistrant rr ON pa.Id = rr.PersonAliasId
    JOIN Registration r ON rr.RegistrationId = r.Id
    JOIN RegistrationInstance ri ON r.RegistrationInstanceId = ri.Id
    JOIN RegistrationTemplate rt ON ri.RegistrationTemplateId = rt.Id
    LEFT JOIN SignatureDocument sd ON rt.RequiredSignatureDocumentTemplateId = sd.SignatureDocumentTemplateId 
        AND sd.AppliesToPersonAliasId = pa.Id 
        AND sd.BinaryFileId IS NOT NULL
    WHERE pa.PersonId = @personId
    AND ri.Id IN (1454, 1662, 1661)
{% endsql %}
{% assign size = results | Size %}
{% capture registrationBalance %}
    {% if size > 0 %}
        {% for result in results %}
                {% registration id:'{{ result.RegistrationId }}' securityenabled:'false' %}
                    {% assign balance = registration.BalanceDue %}
                    {% if balance > 0 %}
                        <span class="label label-danger">Balance: {{ balance | FormatAsCurrency }} on {{ registration.RegistrationInstance }}</span>
                    {% elseif balance == 0 %}
                        <span class="label label-success">No Balance on {{ registration.RegistrationInstance }}</span>
                    {% endif %}
                {% endregistration %}
        {% endfor %}
    {% else %}
        <span class="label label-danger">Not Registered</span>
    {% endif %}
{% endcapture %}
{% capture registrationWaiver %}
    {% if size > 0 %}
        {% for result in results %}
            {% assign docStatus = result.Status %}
            {% if docStatus !=2 %}
                <span class="label label-danger">Waiver Not Signed</span>
            {% elseif docStatus == 2 %}
                <span class="label label-success">Waiver Signed by {{ result.SignedByPersonAliasId | PersonByAliasId }}</span>
            {% endif %}
        {% endfor %}
    {% else %}
        <span class="label label-danger">No Waiver Found</span>
    {% endif %}
{% endcapture %}

<div class="row" style="display:flex; justify-content:center;">
    <div style="display:flex;flex-direction:column;width:fit-content;font-size:1.5em;max-width:500px;">
        <h4>{{ personId | PersonById | Possessive }} Camp Info</h4>
         //- Registration Balance
         <div style="margin:5px;">
            {{ registrationBalance }}
        </div>
         //- Registration Waiver
         <div style="margin:5px;">
            {{ registrationWaiver }}
        </div>
         //- Bus
         <div style="margin:5px;">
            {% if bus !=empty %}
            <span class="label label-success" style="width:fit-content;font-weight:500;">{{ bus }}</span>
            {% else %}
            <span class="label label-danger" style="width:fit-content;font-weight:500;">No Bus Placement</span>
            {% endif %}
        </div>
         //- Cabin
         <div style="margin:5px;">
            {% if cabin !=empty %}
            <span class="label label-success" style="width:fit-content;font-weight:500;">{{ cabin }}</span>
            {% else %}
            <span class="label label-danger" style="width:fit-content;font-weight:500;">No Cabin Placement</span>
            {% endif %}
        </div>
         //- Team
         <div style="margin:5px;">
            {% if team !=empty %}
            <span class="label label-success" style="width:fit-content;font-weight:500;">{{ team }}</span>
            {% else %}
            <span class="label label-danger" style="width:fit-content;font-weight:500;">No Team Placement</span>
            {% endif %}
        </div>
         //- Small Group
         <div style="margin:5px;">
            {% if smallgroup !=empty %}
            <span class="label label-success" style="width:fit-content;font-weight:500;">{{ smallgroup }}</span>
            {% else %}
            <span class="label label-danger" style="width:fit-content;font-weight:500;">No Small Group Placement</span>
            {% endif %}
        </div>
    </div>
</div>