Not able to set value for a field

Community Alums
Not applicable

I was having a field called sub type where the field type is choice. The choice value has to get from the from the record producer variable i.e., inquiry. The value of variable and choice are same and also both the variable and choice label are also same. I have written the code in the record producer script to set the value of the sub type field but it was not getting updated. 

Record producer script to set the value of the field is:

current.sub_type=producer.inquiry;

 

can anyone help me with this

3 REPLIES 3

AakashG2703
Mega Guru

Hi @Community Alums,

Hope you are doing well.

 

Proposed Solution

Kindly follow below points to rectify an issue: -

  1. Is there any error message you are able to see on your screen while submitting the record?
  2. If no, then while submitting the record, a new record is getting created without setting the value to that choice field. Confirm?
  3. Try to check the backed names of the variable "inquiry" and field "sub_type" are correct.
  4. Try to check whether you clicked on the "Map to Field" checkbox as checked in "inquiry" variable and map to the correct field "sub_type" of the table. If this checkbox is checked, then you even don't need to write the script, it'll map your variable to that field automatically.

If you find any information/knowledge/solution helpful, please don't forget to mark my solution and reply as helpful and accepted.

 

Thanks 🙂

Aakash Garg

ServiceNow Developer

Community Alums
Not applicable

@AakashG2703 

1.Firstly i didnt see any error message

2.Verified the backend names are correctly mentioned

3.The field is consist of the choice which belongs to other dropdown so thats the reason trying to do that without using map to field

Mark Manders
Mega Patron

Why the script? If it's a record producer you can just map the fields on the inquiry variable (especially when the values are the same).


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark