Apr 30, 2024 06:20 AM - edited Apr 30, 2024 01:47 PM
Hi, this is a Voiceflow specific question, but I was hoping someone might have some ideas.
I'm making an API call from Voiceflow using a multiple filterbyFormula to exclude words. This is what it looks like:
https://api.airtable.com/v0/appname/tablename?fields%5B%5D=Title&fields%5B%5D=Link&filterByFormula=AND(FIND(%22Long%22,%20%7BHair%20(Style,Color)%7D)%20%3E%200,%20FIND(%22Very%22,%20%7BHair%20(Style,Color)%7D)%20%3D%200 )
The above works without issue. The problem is that my filterbyFormula changes often and needs to be contained within a variable so my actual call from Voiceflow looks like this:
https://api.airtable.com/v0/appname/tablename?fields%5B%5D=Title&fields%5B%5D=Link&filterByFormula=AND({filter1 })
This is working fine when I'm looking for a Match, i.e when {filter1} = FIND("Long", {Hair (Style,Color)})>0
But if try for No match, i.e. when {filter1} = FIND("Very", {Hair (Style,Color)})=0, I get the INVALID_FILTER_BY_FORMULA error. So the problem seems to be tied to the "=0".
TLDR -- When I store my filterbyFormula in a Voiceflow variable, ">0" gets returned but "=0" gives me error
I've tried https://codepen.io/airtable/ but it didn't solve my problem, so I'm worried it could be on the Voiceflow side. But I welcome any ideas from Airtable pros here.
thanks!
Solved! Go to Solution.
Apr 30, 2024 09:55 PM - edited Apr 30, 2024 09:55 PM
Hmm, could I confirm that when you tried the formula with the "=0" with something like Postman it worked fine? In Voiceflow, are you able to change that "=" to be "%3D" to see if that helps?
May 01, 2024 07:07 AM
Okay, so I just tried replacing my "%3D"' with "="' and it works. Strange, as I had it that way before and it wouldn't work. Anyway, it's working now!
Apr 30, 2024 09:55 PM - edited Apr 30, 2024 09:55 PM
Hmm, could I confirm that when you tried the formula with the "=0" with something like Postman it worked fine? In Voiceflow, are you able to change that "=" to be "%3D" to see if that helps?
May 01, 2024 06:10 AM - edited May 01, 2024 07:07 AM
Hi Adam,
The formula I'm using includes the %3D. (https://api.airtable.com/v0/appname/tablename?fields%5B%5D=Title&fields%5B%5D=Link&filterByFormula=AND(FIND(%22Long%22,%20%7BHair%20(Style,Color)%7D)%20%3E%200,%20FIND(%22Very%22,%20%7BHair%20(Style,Color)%7D)%20%3D%200 )
It's working fine written out, but if I put in variable like this --> https://api...=AND({variable }) then I receive the error.
However, I ONLY receive the error when trying to exclude values (when %3D0, is involved). Strangely, I can include as many find values (%3E), as I want and it will continue working but the exclusion is tripping it up.
Thanks for any thoughts or suggestions. I'm stuck and not getting any answers from the Voiceflow side of things.
May 01, 2024 07:07 AM
Okay, so I just tried replacing my "%3D"' with "="' and it works. Strange, as I had it that way before and it wouldn't work. Anyway, it's working now!
May 01, 2024 07:05 PM
Hahaha sigh, I've been there. Glad you got it sorted!