Oct 03, 2022 04:18 PM
Hello all,
I am stumped. I am trying to combine data from two multiple select fields, into one. For the sake of confidentiality, I have created an example of what I am working with, using part of the Greek alphabet instead of the actual data:
The goal is to combine these two columns into a third that looks and behaves exactly the same as the first two, simply with the data from both combined, into one. As easy as this feels like it should be, every single option I’ve seen either turns the output into text strings (which renders it useless for our tracking purposes), or else it requires a great deal of manually typing or copy-pasting the individual options of the multiple select, into the formula, one by one. It should be noted that while I have only used four Greek letters here, the actual number of entries we are working with is well over 600, and with far longer names, so such a process would be a grueling time-consumer.
Surely there must be some way to automate this?
Also note that there are a couple rows in which both columns already share one of the Greek letters - assuming that there IS a way to automate this, is there also a way to account for/deal with potential duplicates?
Thank you!
Oct 12, 2022 02:14 PM
This popped back into my mind today and I was curious @Lif_Alcon if the automation example I showed you ended up being helpful?
Dec 19, 2022 07:31 PM
@Nathaniel_Grano Hi, thanks for your solution. I tested on my base and it works fine...for the first time. However, as I updated the trigger volume by adding new choices/option to that multiselect field. All the options in the combined field, including the newly added one got consolidated into a lengthy option.
Initially: (Orange)(Apple)
Added (Pineapple) to the trigger field
After automation: (Orange,Apple,Pineapple)
Multiselect field has always been something interesting as I get to know Airtable, however it does not work properly sometimes. If you can help me with this, would be really great.
Thanks
Dec 20, 2022 08:57 AM
Hi @ThanhLong ,
I'm having trouble reproducing your issue. Can you give me an example in more detail? Here's what I tried:
1) Set up the example from before with 2 "trigger" columns named "Field1" and "Field2". Each one contained the options: Apple, Banana, Carrot, Grape
2) Set up the automation
3) Create an item with "Apple" in Field 1 and "Banana" and "Grape" in Field 2
4) Automation produces correct value: "Apple", "Banana", "Grape"
5) Add "Pineapple" to Field1 choices and edit the record to include "Pineapple" in Field1.
6) Automation produces correct value of "Apple","Banana","Grape","Pineapple"
What were the steps you followed that led to the wrong outcome?
Jun 10, 2023 06:46 PM
Hi @Nathaniel_Grano . Did what you said and it works fine but I also get a little blu with no info inside like in your picture above on record B after the "Beta". Why does that happen? How can you create an automation to remove those itens?
Jun 10, 2023 08:16 PM
Hi @tsallis,
What's happening is that the automation merges the values from both trigger columns even if one of those columns is empty. To avoid those empty values, you could change the original automation to use several Conditional Actions instead of a single "Update Record" action. To do this, make the following changes:
Jun 10, 2023 08:33 PM - edited Jun 10, 2023 08:41 PM
I will try that but I am afraid because I am combining 6 different fields. I am guessing it will be a very long automation to write...rsrsrs. Would you try a different approach?
Is there a way to make an automation that removes those itens instead?
Thanks for the help
Jun 10, 2023 08:51 PM
I have the same issue; this would require too many rules. The only remedy right now is occasionally removing the blank option from the multi-select field...
Jun 10, 2023 09:32 PM - edited Jul 23, 2023 09:41 PM
If you are on a higher-tiered plan, you could certainly use a script action to combine the fields, ignoring blank ones.
Here's an alternative approach that doesn't require scripts that seems to work:
Explanation:
When multi-select values are copied into a text/formula column, you get a comma-separated list. Our "Calculation" formula combines all of the fields together, adding commas to stitch them together, but skipping fields that have no values. This means calculation will always either be empty or a list of values ending with ", ".
The "Trim" formula removes the trailing ", " if Calculation is not empty.
Our updated automation simply copies the trimmed, merged string back into the multiselect merge field, which does the deduplication work for us automatically.
Edited to correct the TRIM formula 2023-07-24
Jun 11, 2023 05:06 AM - edited Jun 11, 2023 07:52 AM
It worked! This is the final formula I use! Tks a lot for the help! That was a classy move ....rsrsrs
Jul 22, 2023 06:16 PM
Hi Im trying this as well but the