setting the value of a field from the variable value of a record producer

charan_1
Tera Contributor

Hi all,

I was having a record producer where there was variable called test i need to get the value of the variable of test and these has to set to the field i.e., document and field type is choice. The value of the variable and the value of the field are same but it was not setting. The below is the record producer script. Can anyone help me how to resolve this issue.

 

current.document=producer.test

 

 

11 REPLIES 11

@charan_1  Just a suggestion to give it a try, both variables are “Choice” type. 

If both the choices are having the database values are also same? 

Text : Example

Database Value : Example or example

 

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

@Sujatha V M 

Thanks for the reply both the text and datebase value are same in variable as well as the field choices but still it was not working

 

Thanks,

Charan

Can you try this condition in your script,


if(producer.<variable> != ‘’){
current.<field name> = producer.<variable>;

}

 

Add a log within the loop and check. I would like to know if it comes as undefined or with value. 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

@Sujatha V M 

Tried this it was not working

@charan_1  Is this the only field you trying to cascade to a record on another table? Or is there anything else? 

Refer this link :  https://www.servicenow.com/community/itsm-forum/mapping-field-from-record-producer-to-another-table-...

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.