Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

can we populate select box field to reference field

kamleshrathore
Kilo Contributor

Hi Team,

lets i have one choice list field in the record producer and that choice field value i want to populate to reference field of the change_request form

is it possible or not ,if yes the please help me how

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Kamlesh,



Yes, you can do this. In the record producer script, it would look something like this:



For the moment, I'm going to make a big Assumption that your value and label are the same in the record producer's choice field. Example: "Phoenix" and "Phoenix". I'm also going to assume that the value aligns with a display value in the table being referenced in the change_request. If those assumptions are incorrect, please provide details. Otherwise, the statement you want to add in your record producer is this:



current.u_ref_field.setDisplayValue(producer.u_choice_field);



Modify u_ref_field and u_choice_field to work with your situation.


View solution in original post

5 REPLIES 5

I would like create new choices for variable which are not present in the reference field table. In that case how does it works