It was supposed to be so easy. And I'm sure it's possible to do this. The particulars are what's irritating. My hope is that I post this and then figure it out tomorrow morning while on my jog.
Here's the ask:
A group wants to read a multi-select field on an issue. From that, Fusion would read the choices and map them to another multi-select field.
Considering it's multi-select, if the choices were A and E on the first field, Fusion would chose 1 and 3 on the second field.
I know we're dealing with an array because we're dealing with a multiselect, so I try iterating out all the choices. Then, I set a variable using an IF statement...
...
And I don't know how to aggregate those choices by Issue so I can set the choices on the second field.
I'm almost certain that we have an example of something similar in one of our scenarios but I can't find it.
This has to be easy and has to be a relatively straightforward and common use of Fusion but I'll be dang darned if I could figure it out between meetings.
Any hints would be greatly appreciated and would be credited to you as a free drink if I ever run into you at a Workfront event.
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
John
First, I'll cover how I would tackle this, then I'll cover where it's going to get sticky.
Process
Where it's going to get sticky is with a fun quirk of Workfront. If only a single object is checked on a multiselect, it comes in as a simple string, and not an array, but the merge function only works on an array. So what you end up having to do is check to see if the value provided is a string or an array, and if it's an array, then huzzah, nothing further required. If it's a string, then you have to convert it to an array, then pass it into the merge.
John
First, I'll cover how I would tackle this, then I'll cover where it's going to get sticky.
Process
Where it's going to get sticky is with a fun quirk of Workfront. If only a single object is checked on a multiselect, it comes in as a simple string, and not an array, but the merge function only works on an array. So what you end up having to do is check to see if the value provided is a string or an array, and if it's an array, then huzzah, nothing further required. If it's a string, then you have to convert it to an array, then pass it into the merge.
This all makes sense and feels like it should work but it doesn't.
I've done as you suggested and added single-answers into an array of its own and merged it with the multi-select field. I then went to create this array:
It *should* be pulling more than one option for many of these but it's only pulling one per. And I cannot find where it wouldn't...which doesn't mean there isn't a reason.
Does anything look off with that?
Views
Replies
Total Likes
It looks like when you mapped in your 58.combined array, you only mapped the item in the 1st slot of the array. Is that what you intended?
Views
Replies
Total Likes
So when I took that screenshot, it wasn't working. And trying slots was one of those things when it's not working and you try anything--like looking in your sock drawer for your car keys.
I did indeed get it working though! When I first looked through your solution, I didn't do every single choice in the multi-select. I tried doing a "contains(field;<partial name of three choices>)." Once I made every single choice on the typeahead, everything worked fine.
Sorry for the delayed response; things are rather nuts, but I wanted to thank you! This taught me so much!
Happy impending weekend!
-j
I know that this is an old post but I am facing the same issue with my Fusion scenario now. I am able to set variable by using the merge expression to combine the multi select fields. Everything works fine until someone chose a single value on those multi select fields. Are you able to explain further how can we check if the value provided is a string or an array and how to convert them to an array? Is there a way to make sure that the fields are put as arrays no matter if they are filled with multi or single values?
Your help is greatly appreciated. Thank you!!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies