Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Unwanted Space Generated By Formula

Topic Labels: Formulas
378 2
cancel
Showing results for 
Search instead for 
Did you mean: 

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:

Screen Shot 2020-09-11 at 2.50.30 PM (2)

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?

2 Replies 2

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.

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:

Screen Shot 2020-09-14 at 11.44.21 AM (2)

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!