Tools "Set Variable" if() formula always returns first condition regardless of input value

:bullseye: What is your goal?

I want a Tools “Set Variable” module to evaluate why someone was disqualified from a Tally form and save the correct reason to Airtable. There are 4 possible reasons: Under 18, Over 65, Not English comfortable, Not available.

:thinking: What is the problem & what have you tried?

The Tally Age field comes through as an array (Age). No matter what the person selected, the variable always outputs “Under 18” or empty — never the correct reason.
I have tried:

first() typed manually
first() inserted from the array functions panel
contains() from the array functions panel
Direct comparison with no wrapper

Current formula:
if(first(Age) = “1–17”; Under 18; if(first(Age) = “66+”; Over 65; if(first(English) = “No”; Not English comfortable; Not available)))
When I run the scenario and click the Tools module bubble, it shows Variable value: empty.

:clipboard: Error messages or input/output bundles

No error shown — scenario runs green
Tools module OUTPUT shows: DisqualifyReason: empty
Airtable confirms Age field value is exactly 66+ for test records

:link: Create public scenario page

Hey there,

I don’t see a module with such a formula in the scenario you shared. Can you show a screenshot and copy/paste the formula using the code formatting option so it gets preserved?

image

The output values need to be wrapped in quotes because without them, Make treats these as undefined variables and returns empty.

Try doing this:

if(first(Age) = “1-17”; “Under 18”; if(first(Age) = “66+”; “Over 65”;

if(first(English) = “No”; “Not English comfortable”; “Not available”)))

If there are still empty returns after that, the next thing to do is to check whether the dash in “1-17” is an en dash (–) as opposed to a regular hyphen(-).

Tally sometimes outputs special characters that look identical but do not match. Copy the value directly from a test bundle output rather than typing it in manually if you are unsure.

Ran into a similar headache last week while setting up conditional routing rules for user enrollment profiles. Beyond the syntax and special character mismatches mentioned above, there is an underlying data type issue in Make that often causes nested if() statements to fail silently.

When Tally sends a payload, numerical arrays or options are occasionally processed as text strings or numbers depending on how the initial webhook was initialized. If Make expects a string but receives a raw integer, the exact match operator (=) will drop straight through to the fallback condition (“Not available”) or return a null value.

For anyone arriving here from a search engine while troubleshooting this same module loop:

  • Force String Matching: Wrap your array element in a string converter function like toString(first(Age)) before running the comparison. This guarantees Make evaluates the literal characters rather than the underlying data type.

  • Inspect the Blueprint: Open the incoming data bundle and verify if the data contains hidden spaces (e.g., "66+ " instead of "66+").

Taking these extra verification steps usually resolves the issue if your quote marks and dashes are already perfectly formatted.

Neither of these statements is true.

If you add quotes inside the if statement, it will only work if the input also has quotes.

And wrapping an integer in toString() in order to check it with {{=}} is pointless and achieves nothing. {{=}} works either way and will evaluate it.

Only the suggestion about the empty spaces check is relevant in both the comments above.