I'm using Fusion and working on a setup where I want to assign specific roles to a task based on selections in multiple fields. The best method I've found so far is using the Misc Action module with logic strings for each role. When a field indicates a role is needed, I assign the corresponding Role ID. However, when a field is not selected, I encounter an issue.
Initially, I tried setting the result to null when a role wasn't needed, but that generated an error. To work around it, I've been assigning a default role—specifically the project manager role, since they are always assigned to tasks. However, this results in the project manager being assigned multiple times when fewer roles are selected. For example, if two out of five fields are selected, the project manager role ends up appearing three extra times in the task.
Here’s a basic idea of the logic I'm using for Role IDs: If (Field selected = yes; assign specific role, otherwise project manager role).Screenshot below.
Do you have any advice on how I can avoid the duplication issue? I also tried using the API module, but I wasn’t successful. Any suggestions would be greatly appreciated!
Also, If I can just create a module that allows be to add a RoleID without overwriting previously added RoleIDs. I am open to that.
Views
Replies
Total Likes
Hi,
I don't know, why it is not visible or shown in your screenshot, but as roleIDs expects an array, you will need to use the emptyarray keyword, when a role is not needed instead of using null.
Did you try that already?
Regards
Lars
Views
Replies
Total Likes
@lgaertner I did a huge facepalm once I saw your reply. I made the change:
But still got the same errors as when I used blanks or null:
Views
Replies
Total Likes
Hi John,
The API as well as the Fusion module seem to be a bit buggy here:
In the module you need to pass an array to all fields expecting multiple values (userIDs, roleIDs, teamIDs). So you will also need to pass the emptyarray to userIDs and teamIDs.
But doing that, will lead you to the next problem, as the field teamID (singular) expects a valid ID.
If I configure the module like this:
I do get the error message
The operation failed with an error. [422] Invalid Parameter: teamAssignments value "exception.invalidparameter". teamID is invalid.
This also happens, if I use a real roleID and also, if I enter any of the keywords null or erase into the teamID field...
At the moment I do not have any idea, how to simply assign a role...
I am also using the assignMultiple action on Tasks in some of my scenarios, but we are only assigning teams.
Sorry for not being able to find a solution.
Regards
Lars
Views
Replies
Total Likes
@lgaertner Thank you for giving it a try. Yes, it's definitely buggy. I ended up using an Update Record module with the deDuplicated function, but it only partially worked. Strangely, it only removed one duplicate when I left it blank, as shown in the image below. When I tried repeating the process, it removed some non-duplicate IDs, which was odd.
It feels like some of these less frequently used functions might not get enough QC testing and refinement.
Views
Replies
Total Likes
Views
Likes
Replies