SQL Queries Not Accepting Form Values
Goal
Dynamic SQL queries rendering ?
values when run, even though the tooltip shows the correct values being passed into the query. I'm trying to parse the values from a form and use them to run a SQL transaction block on submit (values for two of these fields left empty intentionally for this screenshot):
Steps
I've tried using an in-line ternary operator, and I've tried assigning the results of a subquery to a global variable. Neither has worked
Ternary operator approach
The memberOrAffiliateType
field of the form appears to be populating correctly. The tooltip below indicates that the value is being passed from the form to the SQL correctly, in theory:
Global variable approach
I tried writing a second query and outputting the results to a global variable. I'm seeing the same compilation errors in the SQL at runtime:
This query pulls in the value from the form and conditionally returns the proper column name:
The variable pulls in the results array and parses it like so:
Similarly as the first approach, the tooltip indicates that the value is being recognized by the UI but is raising a syntax error when I hit "run":