Apr 30, 2024 02:08 PM
Hi everyone! I have an Airtable base for a virtual event my team is planning for Learning at Work Week. The base includes the following:
Within the "Participants" table, I have a lookup field that lists all of the activities that that user logged via the form. This is fine, but we are trying to plan for people forgetting which activities they logged. If they submit the form multiple times throughout the week (which we're encouraging) and they forgot what activities they already logged, they might pick the same option again when submitting their response, thus creating duplicate activities within that lookup field. For example, if Bob filled out the form twice and selected "Listening to the Sustainability podcast" both times, it's going to count twice towards his activities (and his overall points), even though all activities are only intended to be completed once.
I tried to do this using a rollup with the formula ARRAYUNIQUE(values) but duplicate values were still included. Does anyone have any ideas?
Thankful for any help you can provide!
Solved! Go to Solution.
May 01, 2024 06:13 AM - edited May 01, 2024 06:15 AM
This is because a lookup of a multi select field is technically an array of arrays - a list of lists.
Say submission 1 contains options A and B, and submission 2 contains options A, B, and C.
When you lookup or rollup these values, airtable sees them as [["A", "B"], ["A", "B", "C"]].
In other words, it doesn’t look at the individual values, it looks at each submissions’ options as a whole. That’s why ARRAYUNIQUE() doesn’t work in this case. Theoretically, you should be able to use a combination of ARRAYUNIQUE() and ARRAYFLATTEN(), but... apparently, this is a bug that still hasn't been fixed when it comes to multi-select fields.
Check out this post: https://community.airtable.com/t5/other-questions/rollup-array-unique/td-p/116315
In it, the brilliant @kuovonne and @ScottWorld provide a workaround to get this to function how you would want.
To quote Kuovonne:
May 01, 2024 04:06 AM
Hey Bredah,
In the Form Responses table you can set Link field to "Filter record selection by a condition" and set that Participants has none of Participants.
Given that you name all Participants link fields the same.
Thanks,
May 01, 2024 06:13 AM - edited May 01, 2024 06:15 AM
This is because a lookup of a multi select field is technically an array of arrays - a list of lists.
Say submission 1 contains options A and B, and submission 2 contains options A, B, and C.
When you lookup or rollup these values, airtable sees them as [["A", "B"], ["A", "B", "C"]].
In other words, it doesn’t look at the individual values, it looks at each submissions’ options as a whole. That’s why ARRAYUNIQUE() doesn’t work in this case. Theoretically, you should be able to use a combination of ARRAYUNIQUE() and ARRAYFLATTEN(), but... apparently, this is a bug that still hasn't been fixed when it comes to multi-select fields.
Check out this post: https://community.airtable.com/t5/other-questions/rollup-array-unique/td-p/116315
In it, the brilliant @kuovonne and @ScottWorld provide a workaround to get this to function how you would want.
To quote Kuovonne: