TextJoin: Gather content of several fields into one (AABBCCdd)

Topic Labels: Formulas
926 1
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Hey Community,
I’ve made this on Gsheet and I would like to do it on Airtable. Any idea?
Capture d’écran 2020-07-30 à 08.39.58


1 Reply 1

Welcome to the community, @Romain_Wiplier! :grinning_face_with_big_eyes: Airtable’s operator for concatenating several items into a single string is the ampersand (&) operator. The general pattern would be:

item1 & item2 & item3 & ...

Each item can be a literal string (wrapped in quotes), a field reference, or even a function that outputs a string, like DATETIME_FORMAT().

In your case, the formula would start like this:

AA & "_" & BBB & "_" & Name & "_" & ...

Just keep that pattern going to add each field and the underscore separators between them.

In a case like (ff) where the field might be empty, you could include an IF() function to only include that piece (and its underscore) if the field isn’t empty. Extending my above example a bit farther, it would look like this:

AA & "_" & BBB & "_" & Name & "_" & CCC & "_" & ZZ & IF({(ff)}, "_" & {(ff)}) & "_" & A & ...

Notice the curly braces around the field name. Those are only necessary in certain cases, mainly if your field name contains spaces or certain special characters (like the surrounding parentheses in your example).