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,158 Points 1k badge 2x thumb

Posted 1 year ago

  • 1
Photo of John Dahlberg

John Dahlberg, Champion

  • 2,442 Points 2k 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,224 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

  • 2,442 Points 2k 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,158 Points 1k badge 2x thumb
Thanks.  Will this work for UI-only fields?
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 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.