Question

Photo of Tommy Prater

0

Lava using Parents to get Husband and Wife name on letter

Im trying to get a merge templete to include spouse on it. 

Example: Dear Tommy and Abby,

{% assign rowPerson = Row.Id | PersonById %}
{% assign parents = rowPerson | Parents %}
Dear {% for person in parents %}
{{ person.NickName}}
{% endfor %},


I relieze in this example it wouldn't have the "and" in that. I was going to use the "Join" for that but I can not get it to return the names in general. On the merge templete it did the first page but only included the Spouse name and did not include the main person name then the rest of the rows didnt include any of the names.

  • Photo of Steven Klass

    2

     

     

    Hi Tommy,

    Can't you do something like this?

    {% assign spouse = 0 %}
    {% assign parents = Person|Parents %}
    {% for parent in parents %}
        {% if parent.Id != Person.Id -%}
            {% assign spouse = parent.Nickname %}
        {% endif -%}
    {% endfor %}
    
    {% capture greeting %}Dear {{ Person.Nickname }}{% if spouse != 0 -%} and {{ spouse }}{% endif -%}, {% endcapture %}

     

    HTH!