- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 02:39 PM
Hello,
I have a requirement to use a Select Box to list a bunch of Group Names that correspond to a Group Leader. Depending on which group is selected, the corresponding group leader should be selected as the person the approval email will get sent to.
I thought to use a Select Box to list the Groups and have the group name as the Text and the Group Leader as the Value. Eg below:
I then thought that this user would then be able to automatically populate a reference field with the users name and then this field could be used to reference the approver, but I cannot get the field to populate.
Can someone please assist with how to achieve this as I am stuck.
Regards
Mike
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 02:19 PM
I managed to get this working by setting the Value in the Select box to the sys_id of the user's name and then used a Client Script to update the Reference variable.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
// Get the group leader from the selected option
var groupLeader = g_form.getValue('product_or_platform_service_lead_coe');
// Set the value of the Group Leader reference field
g_form.setValue('approval_user', groupLeader);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 02:47 PM
You should just let the user select the group. So basically your field should be a lookup select box on the Group table.
And in the group, you can set the manager as the group leader.
Your workflow/flow designer should be configured to set the group manager as the approver.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 02:19 PM
I managed to get this working by setting the Value in the Select box to the sys_id of the user's name and then used a Client Script to update the Reference variable.