[✅ Solution] Multiselect category field type returns array value and not string

I wanted to point out that In Tape a multiselect field returns an array of values and in Podio the field returns a string of all the values separated by commas. this is important if you have in Podio something like:

if (@MultiSelectField) return @MultiSelectField;
if (!@MultiSelectField) return 'Empty';

an empty field in Podio will return the value ‘Empty’ in the example above and in Tape it will return an empty string. the reason for that is that an empty array is also true.

Empty field in Podio: returns null
Empty field in Tape: returns

this can be simply resolved by something like the following:

if (@MultiSelectField.length) return @MultiSelectField;
if (!@MultiSelectField.length) return 'Empty';

I noticed some of my calcs showing different results than Podio so in case someone else runs into the same issue that is the reason.

1 Like

Thanks for pointing this out, @shir. The benefit with this solution is that if category options include "," inside their label, users can still determine the actual selected options.

However, the empty array vs. null thing indeed seems a little counter intuitive. I will discuss this with @Ben eventually, maybe we should revise the implementation there (which would be a breaking change obviously).

We appreciate your perception and your report here.


1 Like