How to write the Catalog Client script for the Approval Process based on the other selection?

Service Now4
Giga Contributor

Hello Everyone, 

I have a requirement that, - Create a New Group like, "Infrastructure Approval" with Approval names in it and add this group to the workflow. Actually,the "Infrastructure Approval" only to be the part of the approval process for the citrix option of this form, not for all the other options. 

Here, I have Created a New Group like,"Infrastructure Approval" with Approval names in Workflow. And i have created a few requests for, if we select the "Citrix" option in 'Targeted OS', the "Infrastructure Approvals" were trigger(It is working fine). But, Here The Infrastructure Approvals were triggered when the Citrix is unselected(it means when we select other options).

Could anyone please suggest me how to write the Script in Workflow for "Infrastructure Approval"/ Catalog Client Script for this( "Infrastructure Approval" only to be the part of the citrix option of this form, not for all the other options)? or if any other usage works?

For your reference, Please find the below Screenshots.

find_real_file.png

find_real_file.pngThanks&Regards,

Jayashree

1 ACCEPTED SOLUTION

Akshata jamdar
Mega Guru

Hello Jayashree,

 

Instead of writing catalog client script you can simply use wait for condition activity and set condition as 

citrix is true.

 

Hope this will help you.

Kindly mark an answer as correct and helpful if it will resolve your query.

Regards,

Akshata

(ServiceNow Developer)

View solution in original post

10 REPLIES 10

Akshata jamdar
Mega Guru

Hello Jayashree,

 

Instead of writing catalog client script you can simply use wait for condition activity and set condition as 

citrix is true.

 

Hope this will help you.

Kindly mark an answer as correct and helpful if it will resolve your query.

Regards,

Akshata

(ServiceNow Developer)

Hi Akshata,

Thanking you for reply...

When we create the Wait condition for "Infrastructure Approval", the field "Citrix" will not be found to set the condition.

Or can we write the Condition Script there?

find_real_file.pngRegards,

Jayashree

Hi Jayashree,

Are you saying if Citrix is selected you need to send approval; if not selected then skip

you can use if activity for this

Ensure you use proper variable name and value for comparison

answer = ifScript();

function ifScript(){

if(current.variables.variableName == 'Citrix')

return 'yes';

else

return 'no';

}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur,

When i have used this Script the same issue i am facing which i have mentioned in the Akshata's reply. It is not going to the next Approvals just the request is closing.

Whether i have to change the flow from Line Manager Approval to Security-SecOps team and the next Approvals?

Thanks&Regards,

Jayashree