Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Record producer approval

akin9
Tera Contributor

Hello Experts,

We have created a record producer to create a new application service.

As of now If user submit a request new application service will create.

we have created a workflow but not working , dont know how to achieve it.

Table - "cmdb_ci_service_discovered"

Approval group - "SN_New_Management"

 

Requirment

1. we want to add Group approvals on that request after approval only new record needs to be created.

 

kindly support to achieve!

 

33 REPLIES 33

Hi @Nayan Dhamane ,

If you have any sample script pls share.thanks!

Hello @akin9 ,

The script is as below:

 

ar tr = new GlideRecord('cmdb_ci_service_discovered');
tr.initialize();
tr.your_table_field= variable.your_variable_name; // use the same to add different fields as well.
tr.insert();
If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.

Hello @akin9 ,

Please mark my answer as correct if it helped you.

 

 

If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.

Hi @Nayan Dhamane and @Ankur Bawiskar ,

Sry for the delay reply , i have achieved this requirment.

I have converted record producer into catalog item using background script

instead of create new one.

@Nayan Dhamane  i have modified from your code and its updating records into the target table.

Example below ,we can add multiple fields as per your requirment.

var ar = new GlideRecord('cmdb_ci_service_discovered');
ar.initialize();
ar.name = current.variables.name;
ar.vendor = current.variables.vendor;

ar.insert();

 

May it will be useful to others. thanks!

Hello @akin9 ,

If my answer was helpful please mark it as correct as it would provide me some motivation to keep helping.

If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.