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

Hello @Nayan Dhamane ,

Hope you are doing good!

Requirment

1.we want to check the duplicate records based on the name.

2.If the name is already exists then request should create and error message should come?

 

How can we achieve this pls  support!

Hello @akin9 ,

If you have use the run script in the modify script as below:

 

var ar = new GlideRecord('cmdb_ci_service_discovered');

ar.addQuery('name',current.variables.your_variable_name);

ar.query();

if (!ar.next()){
ar.initialize();
ar.name = current.variables.name;
ar.vendor = current.variables.vendor;

ar.insert();

}

else{

gs.addErrorMessage("Your message");

}

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 @Nayan Dhamane ,

Thanks for the quick reply.

 

1.We want to do the above before submit a RITM?

2. while submit a req it should query if no existing then req need created.

or else error message.

Hello @akin9 ,

 

You could achieve it by using a on submit client script and a script inlcude.

 

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 ,

Can you pls share the script for this?