Requester / Approver validation in flow designer for catalog item

Pushpanjali3
Tera Contributor

Below steps need to be done but unable to achieve it

 

==>collect all the users group 

==>collect the plm champions (PLM Champion DTIT and PLM Champion SRA groups)

==>compare with the requestor (if requestor is one of the PLM champion list)

-->then we need to skip the approval for that plm champion 

I have created flow designer with the Boolean flow variable script:

var userId = fd_data._1__get_catalog_variables.user.sys_id;
var gr = fd_data._2__look_up_records.records;

if (!userId || !gr) {
return false;
}

while (gr.next()) {
var champUser = gr.user;
if (champUser && champUser.sys_id == userId) {
return true;
}
}

return false;




1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Pushpanjali3 

I don't think you can iterate like this in flow variable script.

why not use GlideRecord in the flow variable script and use true/false as output and then use that in IF logic?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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