Access child relationships through merge syntax

  • 1
  • Question
  • Updated 2 months ago
  • Answered
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}}
Photo of Bill Fox

Bill Fox

  • 8,870 Points 5k badge 2x thumb

Posted 11 months ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,828 Points 20k badge 2x thumb
Photo of Bill Fox

Bill Fox

  • 8,870 Points 5k badge 2x thumb
Yes. I saw that one but it does not work. There are number of answers. Which is correct
Photo of Emily Davis

Emily Davis, Employee

  • 3,610 Points 3k badge 2x thumb
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}}