Unwanted Space Generated By Formula

I am trying to make an Airtable to easily export my product data to the proper format to then upload the csv to our website. The product subcategories need to be listed as such:

“category::subcategory”

I have a formula splitting the multiple select columns into stringified columns, then separated by comma, and so on, until I get four columns that then fit the above formatting.

However, in despite pulling from the same information and having matching formulas, I am getting the second, third, and forth column results with a floating space before the subcategory.

See image below:

Code for the first column:
IF({First Option}=BLANK(),BLANK(),{Cat} & ‘::’& {First Option})

Code for the second column:
IF({Second Option}=BLANK(),BLANK(),TRIM({Cat} & ‘::’ &{Second Option}))

It was happening with TRIM() and without it.

Any ideas?

Your first set of formulas splitting the multiple select field into the {First Option}, {Second Option}, etc fields is picking up the space in in the comma separated values. Try wrapping the values of {First Option}, {Second Option}, etc. in TRIM().

You can also tighten up your formulas so that they do not need the comparison with BLANK().

IF({Second Option}, TRIM({Cat}) & '::' & TRIM({Second Option}))

Another option would be to adjust the formulas for {{Second Option}, etc. to remove the leading space (either with TRIM or some other adjustment. It’s hard to say without seeing that formula.

1 Like

That worked! Thanks, one more thing if possible.

I also need to combined the second and third categories back into a format where they are separated by commas in one column. I have the formula partially working; see below:

However, if the third category is blank, I still need the second option to appear.

The formula I’m using is:

IF(AND({2nd Cat + Sub Cat},{3rd Cat + Sub Cat}),{3rd Cat + Sub Cat} & ", " & {2nd Cat + Sub Cat} & " ")

Any suggestions?

Thanks!

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.