Question

Photo of DJ Grick

0

Plan Your Visit Workflow-Interacting with people

I want to create a "plan your visit" system that sends people a few text messages before they attend. I was hoping to start this after they complete the family pre-registration form. The issue I am having is taking the Family and returning a person to actually interact with. 

Does anyone have any insight on this? 

Has anyone already written a workflow like this that could be shared? 

  • Photo of Jim Michael

    1

    I don't know if this helps (our Plan a Visit system doesn't start with preregistration... it's just a workflow entry page on each of our campus pages), but we *do* use this kind of code within the preregistration block to get the first adult in the family:

    {% assign famgroup = Workflow | Attribute:'FamilyGroup','Object' %}
    {% assign gmems = famgroup.Members %}
    {% for gmem in gmems %}
        {% if gmem.GroupRoleId == 3 %}
            {% assign adultId = {{gmem.PersonId}} %}{% break %}
        {% endif %}
    {% endfor %}

    This assumes you have a FamilyGroup Group attribute set via a Attribute Set From Entity action (with nothing in the Lava) as that's what gets passed from the block to the workflow.

    • DJ Grick

      Sorry, I'm so slow at replying back. How do I then take that person ID and convert it to an actual person in the workflow?

    • Jim Michael

      I would use a Lava run action pointed at your Person workflow attribute, with this as the Lava:
      {% assign famgroup = Workflow | Attribute:'FamilyGroup','Object' %}
      {% assign gmems = famgroup.Members %}
      {% for gmem in gmems %}
      {% if gmem.GroupRoleId == 3 %}
      {% assign adultId = {{gmem.PersonId}} %}{% break %}
      {% endif %}
      {% endfor %}
      {{ adultId | PersonById }}


      That is just the Lava above with a mergefield to take the resulting adultId variable and pass it to the PersonbyId filter.

    • Jim Michael

      Oops... yeah, I didn't realize the Person attribute needed a PersonAlias guid... so try this instead:
      {% assign famgroup = Workflow | Attribute:'FamilyGroup','Object' %}
      {% assign gmems = famgroup.Members %}
      {% for gmem in gmems %}
      {% if gmem.GroupRoleId == 3 %}
      {{gmem.PersonId | PersonById | Property:'PrimaryAlias.Guid'}}{% break %}
      {% endif %}
      {% endfor %}