Skip to main content

I am trying to create a formula to name records by concatenating specific fields but using different groups of fields depending on the item type.


In other words:


IF {Item Type} is Watch,


THEN CONCANTENATE {Field 1} {Field 2} {Field 3}


ELSE


IF {Item Type} is Necklace CONCANTENATE {Field 4} {Field 5} {Field 6}


… and so on for 8 or so item types.


This is how the formula looks currently:



Is it possible to do this?


Help appreciated! I love Airtable but I have no formula skillz.

Sounds like you want to use SWITCH() instead of a nested IF() statement since you’re checking the same variable against multiple possible values:


SWITCH(
{Item Type},
"Watch", CONCATENATE({Field 1}, " ", {Field 2}, " ", {Field 3}),
"Necklace", CONCATENATE({Field 4}, " ", {Field 5}, " ", {Field 6}),
"3rd item type", CONCATENATE(...),
"4th item type", CONCATENATE(...),
"5th item type", CONCATENATE(...),
"some sort of default value if none of the above item types match"
)

Sounds like you want to use SWITCH() instead of a nested IF() statement since you’re checking the same variable against multiple possible values:


SWITCH(
{Item Type},
"Watch", CONCATENATE({Field 1}, " ", {Field 2}, " ", {Field 3}),
"Necklace", CONCATENATE({Field 4}, " ", {Field 5}, " ", {Field 6}),
"3rd item type", CONCATENATE(...),
"4th item type", CONCATENATE(...),
"5th item type", CONCATENATE(...),
"some sort of default value if none of the above item types match"
)

Thanks for the tip! I’ll play around with this tomorrow. :thumbs_up: I’m also going to check out your podcast. 🙂


Update: So far this is working beautifully. Thanks again & the podcast is great. :thumbs_up:


Reply