- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 05:27 AM
Hi Everyone,
I want to create a flow designer action, that takes in input as watchlist users of a record, check if the current user is a part of watchlist user and returns true or false in output.
Can anyone help me with such requirement, I tried to create it but it’s not working, could anyone help me to rectify this?
INPUT:
SCRIPT:
OUTPUT:
Thanks,
Kartikey
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 06:48 AM
You can't. What is the flow doing for which you need this action? Flows run server side, after update. So you can run the flow as the user initiating it and the user will be the one updating the ticket, right? In that case you have the 'updated_by' as current user and you can get the sys_id from there.
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
06-06-2024 05:44 AM
Your Action doesn't have the current user. You will have to add that as input as well. After that, you will need to find the sys_id of this user (or get it in your flow and make the sys_id the input), because the watchlist is an comma separated list of sys_id's. You can then just check on the watchlist containing the user's sys_id.
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
06-06-2024 06:16 AM
Hi Mark, i'm trying to use gs.getUserDisplayName for the current user in the script, won't that work?
and if it won't work then how would i input the currently logged in user as an input?
Thanks,
kartikey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 06:48 AM
You can't. What is the flow doing for which you need this action? Flows run server side, after update. So you can run the flow as the user initiating it and the user will be the one updating the ticket, right? In that case you have the 'updated_by' as current user and you can get the sys_id from there.
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
06-06-2024 05:46 AM
In case you don't need it to be reusable and just a one time thing for a flow, you can also just check within the flow if watchlist contains user_field.sys_id.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark