Best Practice Variable Sets on Record Producers

Brian Lancaster
Tera Sage

I have a bunch of variables that I need to put on multiple incident record producers.  These variables map to fields on the incident table.  I thought I would create this in a variable set but there seems to be a client script that is removing map to field checkbox when I try and create the variables.  Is it not good practice to use a variable set on record producers that map to fields?  Or is there a way to setup the variable set so map to filed is available when I create the variables in the variable set?

1 ACCEPTED SOLUTION

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Brian, its worth noting that the "map to field" checkbox really doesn't do anything other than populate the variable name field with the field selected. The real magic with variables and populating data in the "produced" record is to make sure the name matches a column name in the table associated.  This checkbox didn't exist in early versions of SN and the old school method was to match the name value.

So back to your question of wanting to use variable sets for record producers, absolutely it is recommended so you don't have to maintain as many variables.  Again just make sure the name attribute on the variables match the incident column name.

View solution in original post

5 REPLIES 5

tomashrobarik
Giga Guru

I don't see any reason why not to use a variable set. Of course you will need to take care that these record producers are generating the same target table. You can just edit the variable record in the personalized list where you will add fields like map to field and target table. Or you can just disable the client script that is hiding that field.

Disabling the client script allows me to now check off the box but there is a filed called record produce table and something is making it read only so I cannot put incident in there which is making the fields I can choose from empty.

As I said before, just put that field "record producer table" in the list view of variables. And you should be able to edit it there without any hassle.

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Brian, its worth noting that the "map to field" checkbox really doesn't do anything other than populate the variable name field with the field selected. The real magic with variables and populating data in the "produced" record is to make sure the name matches a column name in the table associated.  This checkbox didn't exist in early versions of SN and the old school method was to match the name value.

So back to your question of wanting to use variable sets for record producers, absolutely it is recommended so you don't have to maintain as many variables.  Again just make sure the name attribute on the variables match the incident column name.