Use UI-only field in a Snippet

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I'd like to use a UI-only field in a snippet.  How can I get the current value?  I've tried this (where 'CoverageNurse' is the Field ID of the Ui-Only field)

var params = arguments[0];
var $ = skuid.$;
var models = skuid.model.map();
var newTeamMembers = models.NewCoverageTeam;

...

{ field: 'MemberId', value: newTeamMembers.CoverageNurse }
Photo of Elissa Bradley

Elissa Bradley

  • 1,672 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Assuming that your newTeamMembers model only has 1 row in it and that's the row you're interested in pulling the value of your NewCoverageTeam Ui-Only field off of, you could do this:

{ field: 'MemberId', value: newTeamMembers.getFieldValue(newTeamMembers.getFirstRow(),"CoverageNurse") }
Photo of Elissa Bradley

Elissa Bradley

  • 1,672 Points 1k badge 2x thumb
That works perfectly - thank you!