Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

Multiple spaces

Topic Labels: Formulas
Solved
Jump to Solution
1793 13
cancel
Showing results for 
Search instead for 
Did you mean: 

I feel like this is simple but I’m missing something. I want 2 text fields joined with 4 blank spaces in between. Field1 & " " & Field2. It is trimming out 3 of the blank spaces on me. Is this possible?

1 Solution

Accepted Solutions

Hi @Btbml!
You can do this two ways.

  1. Save your formula, with spaces, in the formula field. It will either trim spaces or interpret the spaces as a line break (\n). Open and edit the formula until right amount of spaces and no line breaks.
  2. Use the REPT() -function.
    {Field1}&''&REPT(' ', 4)&''&{Field2}

See Solution in Thread

13 Replies 13

Hi @Btbml!
You can do this two ways.

  1. Save your formula, with spaces, in the formula field. It will either trim spaces or interpret the spaces as a line break (\n). Open and edit the formula until right amount of spaces and no line breaks.
  2. Use the REPT() -function.
    {Field1}&''&REPT(' ', 4)&''&{Field2}

Neither of those solutions worked for me. #1 is what I tried. I’ve put 20 spaces in the quotes and the result of the formula only puts 1 in. #2 acted the same unfortunately

Okay, this is what the formula does for me.

:green_square: Column shows the code I supplied and does indeed add 4 spaces.
:red_square: Column shows same thing, but with only one space between info from {Field1} and {Field2}.

example_code_spaces

Have you properly renamed {Field1} and {Field2} to the names of your fields?
If so, what types of fields are your {Field1} and {Field2}, so I can try to recreate the issue?

Weird that it works for you but not showing for me. Here’s a screenshot of mine.
Screen Shot 2021-03-22 at 15.57.35

I agree, that is weird. It works for me even when wrapping in UPPER() like you have.
Hopefully one of the pros will read this and be able to spot the issue so it works for you.

The “Upper” wrapper was an add-on after the fact. More investigation looks like it might just be a browser “rendering” issue. It looks like the value stored in the cell does have the extra spaces, it just doesn’t display it. If I copy the value of the cell and paste into a text editor, or use page designer the spaces are there. This might work for us, I’ll have to see if it passes that way through the api.

Correct. Condensing blocks of spaces is a common thing with most browsers. Anything wider than a single space is ignored. In HTML the only way to force more spaces is to use   for the extras, but Airtable doesn’t recognize HTML in strings.

@momentsgoneby80 What browser and OS are you using? Your particular combination obviously allows larger blocks of spaces, which is not the norm.

I’m using Google Chrome, been for years, so the browser issue never occured to me.
OS = Windows 10

I’m glad there’s an answer for it, because I was stumped.

I’m hesitant to say it’s definitely the answer, but it’s the first thing I’m inclined to check. Chrome on Windows 10 seems like it would be a pretty common combination, so I’m not totally convinced that it’s the answer. Do you have any browser extensions installed that might affect this?

I have a bunch of extensions, but none that should affect this in any way.

Thanks for the help on this. I gave @momentsgoneby80 the solution credit on the original post even though it turned out to be a browser thing.

For me it did it on Chrome on both MacOS 11.2.3 and Win 10.

As it should be. :slightly_smiling_face:

“Did it” meaning showed the extra spaces, or omitted them? I’ve been running Chrome for years, but the extra spaces don’t show. Currently using MacOS 10.15.7

“Did it” - Extra spaces were hidden/omitted