Question

Photo of Russell Cleverly

0

Obtaining Person Attribute through Lava in Workflow

I am trying to create a workflow that "copies" a person attribute to a group member attribute, and I think I have it down except for obtaining the person attribute through Lava. At the very bottom of this screenshot in the field labeled "Text Value" I have attempted many lava statements here but none properly pull the person attribute I am looking for. If I enter an arbitrary value here such as "test" is does successfully copy the text in that field to a group member attribute, so I know the rest of the workflow is functional. 


2020-02-14-10-47-rock.scottsdalebible.com.png

Basically what I am looking for here is  {{ Person | Attribute:'SN-BehaviorTriggers' }} so that the new group member attribute is pulled from the current person's "SN-BehaviorTriggers" attribute.


  • Photo of Charlotte Dean

    1

    When working with the person in a workflow to pull person attributes in, you need to reference the object.  Try this lava and see if it works: {{ Workflow | Attribute:'Person','Object' | Attribute:'SN-BehaviorTriggers' }}

  • Photo of Leah Jennings

    2

    Hi Russell! In that text value box of your "Set a Group Member Attribute" action, try putting this lava:

    Either this:

    {{ Workflow | Attribute:'Person','Object' | Attribute:'SN-BehaviorTriggers' }}

    or

    {% assign personObject = Workflow | Attribute:'Person','Object' %}
    {{ personObject | Attribute:'SN-BehaviorTriggers' }}

    Theoretically both should work, but I haven't tested the first one yet, so wanted to give another option!

  • Photo of Thomas Stephens

    1

    A person attribute in a workflow is really the person's primary alias GUID, not the whole person object. So, when you do lava with the person attribute you need to get the object.

    Also, the person attribute is part of the workflow, so we have to start there.

    {{ Workflow | Attribute:'Person','Object' | Attribute:'SN-BehaviorTriggers' }}

    Make sure that 'Person' is the attribute key value in this case.

  • Photo of Russell Cleverly

    0

    Thank you everyone! 

    {{ Workflow | Attribute:'Person','Object' | Attribute:'SN-BehaviorTriggers' }}

    works perfectly and is exactly what I was looking for