Condition with 'multiple specified values' global merge syntax

  • 1
  • Question
  • Updated 2 years ago
  • Doesn't Need an Answer
I'm trying to display the values active of a condition with multiple specified values using global merge syntax. 

I've tried {{$Model.Potential.conditions.7.value}} and {{$Model.Potential.conditions.7.values}}, both of which are blank on a page title and rich text. 

I understand these values are stored in an array, so that might be why they're not displaying. Is there a way using global merge to display these? My other option is using Javascript on page load to covert the array to a string and update an element to display the values - I would rather not go down that path if there is an easier way
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb

Posted 2 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Try {{$Model.Potential.conditions[7].value}} or Try {{$Model.Potential.conditions[7]value}}
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb
No luck there Pat. I've always used dot notation for global merge:

You could then use $Model.OpenTasks to get a reference to the JavaScript API for this Model. For a full reference into what this returns, we recommend that you go into your browser’s JavaScript Console and do skuid.model.getModel(‘OpenTasks’) and check out what is returned — all of this data is available via $Model.OpenTasks! Just remember that in Skuid Merge Syntax / MustacheJS, object property navigation is via the . operator (period), not via brackets. We often find ourselves doing $Model.MyModel.data[0], which is valid JavaScript but NOT valid Mustache Merge syntax — here you would need to use $Model.MyModel.data.0 instead.
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb
I just tried {{$Model.Potential.conditions.7.values}} again, and it worked. Must have had a typo the first time