referencing field from another model in rich text field

  • 1
  • Question
  • Updated 1 year ago
  • Answered
How do you reference a field from another model in a Rich Text component?

I have a RT component based on my [Contact] model and want to add field details from first row of [Event Model]
Photo of Allison

Allison

  • 1,178 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of John Dahlberg

John Dahlberg, Champion

  • 3,236 Points 3k badge 2x thumb
Model Lookup:

It should look something like this:

MODEL_LOOKUP("OpenTaskCount","countId","casec",{{Id}})

Here's the documentation for it:

https://docs.skuid.com/latest/en/skuid/models/ui-only-models-fields.html?highlight=model_lookup
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,510 Points 10k badge 2x thumb
{{$Model.YourModelName.data.0.FieldName}}

The 0 stands for row 0 which is the first row of your Model.
Photo of John Dahlberg

John Dahlberg, Champion

  • 3,236 Points 3k badge 2x thumb
This is a better approach if you are looking for the first row of the model.  The model lookup is used if you need to pull a record from a longer model based on criteria.
Photo of Allison

Allison

  • 1,178 Points 1k badge 2x thumb
Thanks.  Will this work for UI-only fields?
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,510 Points 10k badge 2x thumb
I believe so. If using UI only, though, John’s Response gives you more flexibility to select specific rows based on criteria.