Flow designer script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
HI Team ,
I need to write the script in the flow designer could you please help me :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @chandan2212 ,
this char will help you
aslo refer this scripts:
// Get the 'Requested by' user from the trigger (assuming trigger is a record)
var requestedBy = fd_data.trigger.current.requested_by.sys_id.toString();
// Define owner sys_ids (can also be retrieved dynamically from a group)
var owners = [
'sys_id_of_owner1',
'sys_id_of_owner2',
'sys_id_of_owner3'
];
// Check if requestedBy is one of the owners
if (owners.includes(requestedBy)) {
// Skip approval
answer = false;
} else {
// Trigger approval
answer = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
You don't have to script. Do a look up to the owner group and then a lookup to the group members where the requested by is the user. If that returns an error, you ask for approval. If not, you skip it.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
is Requested by a variable on form?
what do you mean by Owner?
share some screenshots.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader