Access child relationships through merge syntax

BillBill Member ✭✭
edited May 12 in Questions
I am attempting to access a child relationship on the following in a template in a table:



I thought this would work, but does not.

{{Q_Sales__r.Name}}

Comments

  • BillBill Member ✭✭
    edited May 12
    Yes. I saw that one but it does not work. There are number of answers. Which is correct
  • Emily DavisEmily Davis Skuad ✭✭
    edited July 2019
    Bill, if you want to access a field value on a particular child record, you need to do something like
    {{Q_Sales__r.records.0.Name}}

    Notice that you'll need to specify the index (in the example above, 0) of the specific child record that you want to target off of the row in context (since there could be multiple child records off of a particular row).
    For example, {{Q_Sales__r.records.0.Name}}, {{Q_Sales__r.records.1.Name}}, etc.

    Also note that you can loop through child records on a row like so:
    {{#Q_Sales__r.records}}
    {{Name}}
    {{/Q_Sales__r.records}}
Sign In or Register to comment.