Add recordproducer variable on list view of table

harry24
Tera Contributor

Hello , 

 

How to add variables of a record producer to list view of a table . 

 

Thanks 

8 REPLIES 8

It shows only first configured variable 

@harry24 

please share your configuration.

Also did you configure it as per the link shared?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

vishwajeet5550
Mega Guru

To add variables from a record producer to the list view of a table in ServiceNow, you first need to ensure the variables are accessible in the target table. Record Producer variables are typically stored in the sc_item_option table, but for them to appear in a table's list view, they must be mapped to fields in the target table. Start by editing the Record Producer and writing a script to map the variables to specific fields in the target table, such as populating short_description or a custom field. Alternatively, you can create a string or JSON field in the target table to store concatenated variable values. Once the mapping is done, navigate to the list view of the table, configure the list layout, and add the relevant fields to the view. If variables remain in sc_item_option, you can use a GlideAggregate query or a Business Rule to fetch and display them in a custom field on the target table. After implementing these changes, test the functionality by creating a record through the Record Producer and verifying that the variables appear in the list view as expected. This approach ensures seamless visibility and usability of Record Producer variables in the list view.

Map Field like this :

 

(function executeRule(current, gForm /*null when async*/) {
    current.short_description = producer.variable_name; 
    current.description = producer.variable_description; 
})(current, gForm);

 

 
 

 

vishwajeet5550
Mega Guru
(function executeRule(current, gForm /*null when async*/) {
    current.short_description = producer.variable_name; 
    current.description = producer.variable_description; 
})(current, gForm);