Question

Photo of Adam Mosley

0

Lava Syntax within Workflows

I have created a workflow that will send an email to first-time guests. The workflow has a "Guest" attribute, and an action to "Set Attribute to Entity", which gets the guest's name set as the "Guest" attribute. I would like to personalize the email by saying "Hello (Guest's First Name)". I've been able to figure out how to return the guest's entire name by using "Hello {{ Workflow.Guest }}," but I can't figure out how to only return the first name or nickname. I know that in other instances, you would use {{ Person.NickName }} for this purpose, but in this case, that gives no output (probably because the "person" can't be determined). I had hoped something like {{ Workflow.Guest.NickName }} might work, but it doesn't. Is there someone out there who can help me out with this? I'm not a developer by any means and I've found myself in over my head while trying to do something I thought would be simple (which seems to happen to me often in Rock).

  • Photo of Jeremy Turgeon

    1

    Hi Adam,

    Sorry to hear you're having trouble with this.  Here's what I did to get the workflow to use the person's nickname.

    First, setup the workflow with a workflow attribute of Guest with the Field Type of Person. Second, use the Set Attribute to Entity to set Guest to the Person you want to send it to.  Third, add the action of Send Email and put {{ Person.NickName }} in the Body.  Finally, add this completed workflow to Actions list on the Person Profile page.  You can then click the workflow from the dropdown and it will activate and send the person an email with their nickname.

    NickName.PNG

    FTV.PNG

    Let me know if you run into any trouble with this and I can create an example on the Rock demo site.

    Hope that helps!