Apr 29, 2020 12:46 PM
Hi all!
I have two fields, both filled with features. I want to see which features are repeated in both fields.
For example, I want a column that would tell me that ‘Feature2’ is in both columns of row 1 (record1), Feature3 and Feature4 are both in the columns of record 2 and 'Feature1 and Feature3 are also both there in record 3.
Maybe a formula like: If the text in column A is similar to the text in column B, then insert it in column C?
I hope this is clear! Thanks in advance for your help!
Solved! Go to Solution.
Apr 29, 2020 02:37 PM
OK – well, to do this with a formula, you could make an explicit comparison for each of the 12 features. Something like this:
IF(
AND(
FIND("Feature1", {expected features}&""),
FIND("Feature1", {Available Features}&"")
),
"-- Feature1 "
) &
IF(
AND(
FIND("Feature2", {expected features}&""),
FIND("Feature2", {Available Features}&"")
),
"-- Feature2 "
) &
IF(
AND(
FIND("Feature3", {expected features}&""),
FIND("Feature3", {Available Features}&"")
),
"-- Feature3 "
) &
IF(
...
)
Just continue repeating that pattern.
Apr 29, 2020 02:21 PM
A couple questions for you, @Anne_Sophie_Asselin:
Apr 29, 2020 02:30 PM
tx
Apr 29, 2020 02:37 PM
OK – well, to do this with a formula, you could make an explicit comparison for each of the 12 features. Something like this:
IF(
AND(
FIND("Feature1", {expected features}&""),
FIND("Feature1", {Available Features}&"")
),
"-- Feature1 "
) &
IF(
AND(
FIND("Feature2", {expected features}&""),
FIND("Feature2", {Available Features}&"")
),
"-- Feature2 "
) &
IF(
AND(
FIND("Feature3", {expected features}&""),
FIND("Feature3", {Available Features}&"")
),
"-- Feature3 "
) &
IF(
...
)
Just continue repeating that pattern.
Apr 29, 2020 02:37 PM
This is one of those times when we really need more robust Array functionality built into Airtable! (The array functions are extremely limited at this point.) @Jeremy_Oglesby, do you have any insights on whether or not more enhanced Array functionality is on the horizon?
But luckily for @Anne_Sophie_Asselin, with such a small & non-changing list of features, you could just create a lengthy formula to deal with this. Looks like Jeremy created a great one for you! :slightly_smiling_face:
Apr 29, 2020 02:40 PM
No, I’ve seen/heard nothing about new formulas. I wonder if Scripting block was meant to be their “catch-all” solution for that kind of stuff – which would mean that, eventually, advanced array stuff will only be available to Pro workspaces.
Apr 29, 2020 02:46 PM
OH YESS!! Thanks @Jeremy_Oglesby it worked perfectly!
Just to make sure I understand well, Could you please explain why you added the &"" at the end of the lines starting with FIND?
Thank you so much for your help!
Apr 29, 2020 02:50 PM
Sure –
The data for the Linked Record fields ({expected features}
and {Available Features}
) are held as arrays behind the scenes. When you pull the value of a Linked Record field into a formula, it comes in as an array of values.
The FIND()
function only works on strings. You ask it to find a sub-string inside a larger string. It won’t work if you ask it to find a sub-string inside an array.
So, to force the Linked Record array into being a string, I concatenate the Linked Record field with an empty string – &""
. This coerces the array into behaving like a string, so that the FIND()
function works properly.
Apr 29, 2020 02:50 PM
Ugh, that would be so terrible for the Airtable platform if that was the direction they were planning on going in. It would really hurt people like myself who aren’t JavaScript experts, and it would also mean that they’ve stopped investing in their own low-code/no-code backend.
Apr 29, 2020 02:53 PM
Ya – here’s hoping they continue to flesh out plain old formula fields still!!