Flow Designer issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 11:50 PM
I have below script to run on hr task table everytime task is updated, can anyone tell me how to add this in flow designer? Earlier this code was in workflow editor.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 12:18 AM
@Hafsa1 You need to create a custom action and use a script step to execute this script.
Fore more information please refer to
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 12:34 AM
Hi @Hafsa1
Let's give a try to the below approach. We would need around 5 action steps in the flow to achieve the business needs from your script above.
1. Create new Flow > set Trigger condition to the HR Task table
2. The 1st flow action is For Each, we loop through the Groups field
3. Create Group Member record with the Group and the Opened by
4. Set Flow Variable and collect the Group Managers from each group
5. Fire the event with Group Managers and Requestor
6. Update the current HR Task record work notes.
Cheers,
Tai Vu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 12:44 AM
what kind of data is current.groups? is it a list collector?
you can either create a new action, add a script step and then massage what you've already got into that. Then add that to your flow.
or you can do it in the flow itself which is probably what i'd be trying to do.
If it's a reference field like a list collector, you can use flow designer to get the current record, then use a 'look up records' action
Specify sys_user_group table and conditions = sys_id 'is one of' (trigger record -> variable).
That should return each of the groups selected.
Then you can use 'for each' (group record in look up records), and then:
- create record (sys_user_grmember) -> group = (for each -> group record) and user is (trigger record -> opened_by)
- fire event (sn_hr_core.group_member_added, p1 = (group record -> group manager -> sys_id), p2 = (trigger record -> opened for -> sys_id).
you could update the work notes with the 'user added to group (group->name)' in each loop, or better yet - add to a string flow variable on each loop to build a list
After the for each loop is finished - update record and set the state and add the work notes then.
hope that helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 09:20 PM
Getting error as below: