- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 08:15 PM
Hello,
We have a cat item where the end user can request assignment groups be updated. See screenshot below The user can select new group name and the group manager and optional group membership. Once approved the following function is ran.
We have a defect where if 2 different request are submitted. 1. for changing the group manager and 2. for updating the group members, then if the group manager request is approved first then the manager is updated to the value the user selected. However once the second is approved for the group membership it overwrites the first request because current and new group manager is defaulted to the existing manager at the time the request was submitted. So I need to update the SI to only allow group manager update if New Manager does not equal Current Manger. I thought about doing a gr on Variable Ownership then compare values of the 2 variables but not sure how. Perhaps there is a better way to do this. Any help is welcome.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 10:53 PM
You can add an if-statement to check that they're different values and only update it if it's changing:
// if a different manager was selected on the form, then update the manager field, otherwise don't set the manager field
if(variables.new_manager != variables.current_manager) {
gGroup.setValue('manager', variables.new_manager);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 08:32 PM
Hi @purdue
In the past, I encountered a similar requirement. To address this, we introduced new checkbox variables with options such as 'Update manager' and 'Update group members.' End users need to select the appropriate checkboxes. The flow/script then validates the checkbox values and updates the group record accordingly.
Hope this helps.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 07:29 AM
Thanks for the response. I did not want to update the cat item but I agree I would have a Select Box with values of what the user wants to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 10:53 PM
You can add an if-statement to check that they're different values and only update it if it's changing:
// if a different manager was selected on the form, then update the manager field, otherwise don't set the manager field
if(variables.new_manager != variables.current_manager) {
gGroup.setValue('manager', variables.new_manager);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 06:12 AM
Thanks Nick this worked. I don't why I overcomplicate things. 😀