Populating Column Based On Category of Token

Is there a way I can populate a category column with the appropriate token (ingredient in this case) if its category matches the name of the column?

For example in the screenshot, I want only “3/4 oz kiwi syrup” to populate under Syrup since its “category” (A single select column) under another record is “Syrup”.

Any help is appreciated!

@Duo_Zheng, you can most certainly search for the presence of a word (true or false), but getting the whole phrase is going to be tough since we’re working with a multi-select (an array). I posted a related product request a while back.

Here’s how you search for the presence of a word:

Recipes
Juice
Gin
Gin & Juice

Gin
FIND(“gin”,{recipes})
=> 1

Rum
FIND(“rum”,{recipes})
=> 0

A more complicated formula might involve a series of ‘IF’ statements that look for specific phrases, then return them upon finding them. But that would mean your formulas would need to change as additional options are added to the mult-select - so it wouldn’t be dynamic.

I made a typo in the original post; it should be that category is a single select column.

However using Find would not be a sufficient solution as Gin would fall under the predetermined category of “Alcohol” and I want to find that all “Alcohols” Under Recipe Ingredients (gin, vodka, etc.) fall under the column called “Alcohol” since they have that category.

Is such a thing possible?

Again, you can look for specific words, but if a new option is added then, your formula changes. So not ideal from a maintenance perspective. In this case you’re describing:

Recipes
Rum & Coke

Alcohols
IF( FIND(“Rum”,{Recipes} ), “Rum”, “” )
& IF( FIND(“Rum”,{Recipes} ), “,”, “” )
& IF( FIND(“Gin”,{Recipes} ), “Gin”, “” )
& IF( FIND(“Gin”,{Recipes} ), “,”, “” )
& IF( FIND(“Rum & Coke”,{Recipes} ), “Rum & Coke”, “” )
=> Rum,Rum & Coke

You’d also need to figure out a way to deal with false positives as demonstrated above.

Thanks for the input but it does look complicated to maintain.

Do you know if there’s a way to identify the index of a token or extract tokens by search/find?

No that’s why I wrote the feature request

1 Like