Lava Example - 61 | Rock Community

Lava Example - 65


Prompt

If we wanted to run an action only if the person is baptized and is a member, we can't do both in an action filter.

So we need to use Lava to evaluate both of those conditions and set an attribute indicating whether the action should run.

Let's assume we want to use True or False to set a "Should Continue" attribute.

Knowing that you have a Person workflow attribute, what template would you use to check if they're baptized and a member?

Initial Code
{{ Workflow | Attribute:'Person' }}
Solution Lava
{% assign baptismDate = Workflow | Attribute:'Person','Object' | Attribute:'BaptismDate' %}
{% assign connectionStatusId = Workflow | Attribute:'Person','ConnectionStatusValueId' %}
{% assign memberStatusId = 65 %}

{% if baptismDate != '' and connectionStatusId == memberStatusId %}
    True
{% else %}
    False
{% endif %}