setting the value of a field from the variable value of a record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 05:32 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 10:54 AM
@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
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 10:56 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 11:02 AM
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.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 05:27 AM
Tried this it was not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 05:43 AM - edited 04-16-2024 05:52 AM
@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.
Sujatha V.M.