HI Aric, in this case it was to populate the the record itself before the submission. it does not seem feasible to achieve so, so my colleague has to achieve the goal with another approach. Thanks for your reply


Nick Parsons
Giga Sage

We can use the RP (render properties) API with the getParameterValue() method to get the sys_id of the current record producer like so. You can use this in the producer's script:

 

current.u_record_producer = RP.getParameterValue('sysparm_id');

 

This is the approach recommended by the ServiceNow documentation in the article Populate record producer data and redirect users. 

 

You can however also use cat_item instead (yes, this works in a record producer), which is what ServiceNow use in some of their OOTB scripts, such as in their HRSD app. This has the advantage of being able to access other properties, such as the name of the record producer (via: cat_item.name):

 

current.u_record_producer = cat_item.sys_id;

 

This did work, thank you so much!!

charley_egmose
Kilo Explorer

Hi George

 

I'm not quite sure what you want.

Maybe this on the client side?

g_form.getUniqueValue()

Regards