Rendering Based On Model Value

  • 1
  • Question
  • Updated 1 year ago
  • In Progress
Currently looking to render a field enabled/disabled based on model value but can't seem to get it working as required.

For example, trying to use a "Model field value" with the "Single specified value" of {{{$Model.CurrentUser.data.0.AccountId}}} to determine whether to render a field enabled.

Can't get it to work as I like so having to use a "Snippet returns true" with the following:-

return skuid.$M('LadderTemplate').data[0].DefinedBy__c === skuid.$M('CurrentUser').data[0].AccountId;

Whilst the above workaround gets things done as required, would like to undertsand why the simpler/cleaner approach doesn't work.
Photo of Glen McGoldrick

Glen McGoldrick

  • 100 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Hmm, I'm not sure why that didn't work - it should have. You might double check that the AccountId is included in the CurrentUser model and that the value is what you expect (although it looks like the value is what you expect if it works in the snippet)