Workflow approval script is not working in requted item

986565
Tera Contributor

Hi All,

 

I am using the scripts for the individual approval based on the group person, for the catalog approval

 

Here is my code for the request item

 

current.variables.please_select_sr_approval

 

when i put logs it was printing, but unable to send request for the approval person.

5 REPLIES 5

nayanmule
Tera Guru

Can you please paste the screenshot of your workflow ? Usually script is not required, you can directly use the action if you are using flow designer .

 

Regards,

Nayan

Or else if you are using the workflow then you need to use the .push() function . 

eg.  answer.push(current.variables.<variables_name>.toString());

Ankur Bawiskar
Tera Patron
Tera Patron

@986565 

in your workflow approval user script you should set answer array with the approver

Set the advanced checkbox and give script

I assume your variable "please_select_sr_approval" is reference to user table

answer = [];

answer.push(current.variables.please_select_sr_approval.toString());

AnkurBawiskar_0-1765783187090.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Hi @Ankur Bawiskar ,

I am using the same, but it was not triggering it was showing the empty.

answer = [];

answer.push(current.variables.please_select_sr_approval.toString());