How to create new approval record

SS64
Tera Contributor

I want to create approval record.

I can find  Self Service > My approvals,

but I can't find new button.

find_real_file.pngShould I create it System UI?

In the case ,How to create?

 

4 REPLIES 4

Prateek kumar
Mega Sage

Approvals are either created from flows or Workflows, why do you want to do it manually.

If you want to create an approval for a record, navigate to the related list and create from there.

find_real_file.png


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Miguel Donayre
ServiceNow Employee
ServiceNow Employee

Hello SS,

You cannot just create a new approval. Approvals are generated through the Approval Engine and the Approval Workflow.

 

Utpal Dutta1
Mega Guru

Hey SS,

If you want to create an Approval in My approvals module then you either need to create it using Business Rule or you can do it via  WorkFlow. I'm sharing both script with you, please pick what suits you best.

 

Business Rule Script:

Select the table on with you want this Business rule to run and select a proper trigger. Eg: Insert or Update.

 

Now click on Advance checkbox and write below script in Advance section of Business Rule:

 

Business Rule:

var gr=new GlideRecord('sysapproval_approver');
gr.initialize();
gr.sysapproval=current.sys_id;
gr.approver=current.u_ad_hoc; // Edit this line with the field you want to send approval to. 
gr.state='requested';
gr.insert();

 

The above business rule will run for the table you have selected and on the trigger condition. Eg: Insert or Update.

 

Using Workflow:

 

To use below script you need to drag and drop any Approval activity in your WorkFlow. Eg: Approval User or Group.

 

Script:

var answer = [];
answer.push(current.variables.application_support_person);  // Edit the field name
answer.push(current.variables.application_support_person.manager); //Edit this too

 

 

If the above above answer helps you then please mark my answer Correct and Helpful.

 

Thanks and Regards:

Utpal Dutta

 

 

SAI KUMAR BILLA
Tera Contributor

@SS64

 

You can use the script below to insert the new approvers into the existing records.

 

var appr = new GlideRecord('sysapproval_approver');

appr.initialize();

appr.source_table = 'give the backend name of the table';

appr.approver = 'give the sys id of the user';

appr.sysapproval = 'give the sys id of the source table record';

appr.document_id = 'give the sys id of the source table record';

appr.insert();

 

Regards,

Sai Kumar.