Feb 28, 2020 12:27 PM
SWITCH(PageID, "18479402361", "NKH", "8532248414", “WWP”, "8271670852", “LLS”, "342294162453301", “PP”, "27817332304", “AFSP”, "55701226138", “AHA”, "15687409793", “WWF”, "12692786774", “ALS, "184404096774", “LUPUS”, "105229062888132", “SSS”, "25372476424", “BFAS”, "12596759677", “RAICES”, "14084625156", “SGK”, “13793312555", “MAW”, "1562713090633117", “OUR”, "20876805343", “MOD”, "100438444321", “CCA”, "8492293163", “EDF”, "111541054636", “BTM”, "10331123781", “SO”, "371566686229476", “ADAA”, "342091725962792", “M22”, "8047221596", “STC”, "11791104453", “NRDC”, "81517275796", “UNICEF”, "512423278811960", “DS”, "122531741163825", “ALF”, "22902828717", “BB”, "332378771195", “CF”, "97646191545", “HA”, "44224524016", “AKF”, "332077995968", “LCRF”, "84618074710", “CCC”, "95155519857", “BLISS”, "24470472733", “TP”, "7271534916", “FFB”, "N/A")
Here is my switch formula currently. I have genuinely been looking at this for 45 minutes now and I cannot seem to figure out why it is erroring out. I’m sure it’s a very simple issue but I cannot seem to find the cause. Please let me know if you see any errors. Thanks!
Solved! Go to Solution.
Feb 28, 2020 01:24 PM
There was a quote missing from one of the strings of letters (ALS.).
Mary K
Feb 28, 2020 01:15 PM
Your formula has a mix of straight quotes "..."
and curly quotes “...”
.
Make sure you use only straight quotes.
Feb 28, 2020 01:24 PM
Mar 02, 2020 12:47 PM
Didn’t even notice that, thank you!
Mar 04, 2020 05:43 AM
Any idea, what is max number of patterns and results SWITCH() function can handle?
If that is exceeded, what might be a sidewalk (but not nested IF, I am have about 180 patterns. Thank you
Mar 04, 2020 11:52 AM
I haven’t seen a documented limit on the SWITCH
function. I have see some very long formulas.
On the other hand, you are probably better off with writing a script for the scripting block (unless the info changes frequently). I think it would be much easier. The syntax for a JavaScript SWITCH
is a bit different from Airtable’s formula fields.
Mar 04, 2020 11:54 AM
Thank you, @kuovonne. I am a total lamer in JavaScript and will probably continue with SWITCH() function. So far it handles my 180 patterns and results.