Can a child field be referenced in a formula field on the parent model?

  • 1
  • Question
  • Updated 1 month ago
  • Answered
I have a model with 2 child relationships on them with LIMIT 1 specified.

I'd like to find the greater value of two fields on these 2 child objects and put them into a formula field on the parent object. Is this possible?

How would I go about referencing the child objects in a formula on the parent object?
Photo of Mark L

Mark L

  • 1,146 Points 1k badge 2x thumb

Posted 1 month ago

  • 1
Photo of Pat Vachon

Pat Vachon, Champion

  • 45,310 Points 20k badge 2x thumb
I believe you can use merge syntax in the formula to reference the child record data. Lemeno

If (
{{$Model.YourModelName.data.0.ChildRelation01__r.records.0.field}} > {{$Model.YourModelName.data.0.ChildRelation02__r.records.0.field}},
{{$Model.YourModelName.data.0.ChildRelation01__r.records.0.field}},
{{$Model.YourModelName.data.0.ChildRelation02__r.records.0.field}}
)
Photo of Mark L

Mark L

  • 1,146 Points 1k badge 2x thumb
Thank you this works!