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

Uncle Rob
Kilo Patron

Yes.



Under the type specifications for the variable.   You pick which table contains the field, and which field contains the choices.


find_real_file.png


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.


HI @Chuck Tomasi

lets say that I want to map one select box variable of the record producer to two fields in the incident form i.e., Service field (which is reference from cmbd_ci_service), Categroy field.

Is that possible?

tanumoy
Tera Guru

You can do that.


You can provide the value as the sys_id of the reference field value in the Question Choices.



Untitled.jpg



In above picture, SB is the select box variable which is mapped to assignment group of incident.


In the Question choices of Text Database I have provided the value as the sys_id of the assignment group.



Please let me know in case you have any confusion.