Hello,
I'm using an External Lookup field set as a multi select.
When the data comes into Fusion it sees multiple selected items as an Array as one would expect.
The problem is when 1 item is selected it doesn't come in as an Array. It comes in as Text.
When processing downstream, how do you deal with these type differences? For example, adding the items to an existing array? You can't use merge....
Does anyone have a solution?
thanks,
Kelly
Views
Replies
Total Likes
This was already answered
https://experienceleaguecommunities.adobe.com/t5/workfront-fusion-2-0-questions/how-to-check-if-a-pa...
Views
Replies
Total Likes
Hi @Kelly_StarzEnt - I've run into some similar challenges recently.
In Workfront Fusion, I find there is different behavior depending on how you access the data stored in the field:
"Flatten" is used for when the multiselect field is an array and we want to avoid nested arrays:
flatten(add({{emptyarray}};multiselectField))
"Remove" can be used to remove null or empty values from the array when you are attempting to use other array functions:
remove(merge(array1;arrayVariable);{{null}})
Views
Replies
Total Likes
The way I typically check if something is an array or a string is by running it thru this command.
if(length(get({test variable};1))>1;array;string)
Then if it's a array you can move on, if it's a string then you can do
add({{emptystring}};{test variable})
Note that there is a requirement for this to work where a value in the array will never be 1 character long. Maybe some day Fusion will have an isArray function.
Views
Replies
Total Likes