Help

Re: Function Removes Commas from Multi-Select Fields

3281 6
cancel
Showing results for 
Search instead for 
Did you mean: 
William_Nutt
6 - Interface Innovator
6 - Interface Innovator

Hello! I’m attempting to concatenate two fields—both lookups from another table, one of which contains multi-select items separated by commas. When combining the fields via formula, the result strips out the comma separators from the multi-select field. However, if I use the formula only to display that multi-select field, the commas remain in place. How can I preserve that comma? Thanks!

10 Replies 10
William_Nutt
6 - Interface Innovator
6 - Interface Innovator

Resolved independently! The field is treated as an array; thus, I can apply array formulas.

Daniel_Smith
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi William, I am having the same issue. Can you please elaborate on the fix. I tried ARRAYJOIN({Int Stakeholders/Staff Emails},{Paid Attendee Emails}) but I only get the comma in between the 3 fields.

Patricio_Suarez
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi @William_Nutt. I am trying to turn a multi-select field into simple text. I am running into the problem that if the multi-select option choice has a comma in it, the text output returns within quotation marks. I need to avoid the quotation marks. Any chance you might have run into this problem and found a solution?.

Thank you @Elias_Gomez_Sainz. Unsure on how to use SUBSTITUTE but will do some research. Seems like I am having a dumb problem. Don’t know why the comma is making the text be in quotation marks.

Maybe this example will clarify why Airtable puts quotes around items with commas:

28%20AM

I could use SUBSTITUTE to remove them, as @Elias_Gomez_Sainz suggested:

SUBSTITUTE({Color combos}, '"', '')

But then it looks like I’ve got three items, not two:

00%20AM

For a moment I thought that it might be possible to force a different separator between each item before removing the quotes, so you could have something like this:

Red, green | Blue

I assumed that the items were stored in an array, and that ARRAYJOIN would allow changing of the separator. However, it has no affect whatsoever.

ARRAYJOIN({Color combos}, " | ")

24%20AM

Because I didn’t need to concatenate {Color combos} with a string when doing the earlier SUBSTITUTE test, it appears that Airtable automatically converts the array (if it even is an array) to a string before any formula gets hold of it.

What ultimately did the job was nested series of SUBSTITUTE functions:

SUBSTITUTE(
    SUBSTITUTE(
        SUBSTITUTE(
            {Color combos},
            '", ',
            ' | '
        ),
        ', "',
        ' | '
    ),
    '"',
    ''
)

Screen Shot 2019-05-25 at 9.37.22 AM.png

Thank you so much @Justin_Barrett for this detailed explanation. So appreciate your time to answer.

Worked perfectly. Incredibly grateful!!! Thanks to all.

:thinking: so… SUBSTITUTE.