how to update request variable field values in change description servicenow

sunil kumar11
Tera Expert

I have record producer for change table. When I submit the form the request details should update on change request - description field.

 

sunilkumar11_0-1707921785948.png

 

@shyam10

2 ACCEPTED SOLUTIONS

kps sumanth
Mega Guru

Hello @sunil kumar11 ,

 

You can write your record producer script as below,

 

var desc = '

\n Source Database Instance CI : ' + producer.corresponding variablename+'\n Source MSSQL DB  ORACLE Schema : '+ producer.corresponding variable name + like this add all the 6 variables and in the end add current.description = desc;

View solution in original post

Yeah you could do something like.

current.description = 'Source MSSQL DB: ' + producer.mssql_variable + '\n';
current.description += 'Hostname: ' + producer.hostname_variable+ '\n';
current.description += 'Source Environment: ' + producer.source_env_variable+ '\n';

And so on.

View solution in original post

9 REPLIES 9

kps sumanth
Mega Guru

Hello @sunil kumar11 ,

 

You can use the record producer script, producer object will have access to all the variable of that record producer.

You can access varaible like this producer.variable_name and you can set the description of current record using the current object like current.description.

Please mark this Accepted and Helpful if this worked for you.

The Machine
Kilo Sage

current.description = producer.request_details

 

assuming your field is called request details. This would map whatever value is in that field to the description of the change. 

sunil kumar11
Tera Expert

Hi @The Machine @kps sumanth 

 

Thanks for the response.

I don't want all the field in the description only these 6 filed value should be in the description

Source Database Instance CI :
Source MSSQL DB  ORACLE Schema :
Hostname of server on which database is hosted :
Type of Database Decommission :
INDIRECT and DIRECT Application list :
Source DB Restricted :
Source Environment :

 

sunilkumar11_0-1707922173766.png

 

Can you please help me where i can use this ?

 

You can write the script here, on the record producer form.

kps2_0-1707922162778.png