Trying to build a dynamic URL in . I have an ASSIGN action that sets var_url to base + id. The debug log shows the correct string.
The next IF action checks IF var_url != null. It always hits the ELSE branch.
Does the IF action not evaluate the result of an ASSIGN immediately? Or is there a type mismatch?
The issue is likely a type mismatch. ASSIGN treats the result as a string, but IF might be evaluating against an object type. Try casting explicitly in the IF condition using toString(var_url).
IF toString(var_url) != "null"
Also check if there are trailing spaces in your base URL.
The suggestion above regarding type casting is on the right track, but there’s a subtlety with how Architect handles the assignment. The ASSIGN action doesn’t just set a value; it returns a boolean success flag. If you are chaining actions or using the output of the assignment in a subsequent IF immediately, you might be hitting a race condition or a scope issue.
The docs state: “Variables set in an ASSIGN action are available to subsequent actions in the same flow.”
Try checking the exact value with a LOG action first.
LOG "var_url value: " + var_url
If the log shows the correct string but the IF fails, it’s likely comparing against the literal string “null” instead of a null reference. Use this instead:
IF var_url != ""
Empty strings often trip up the null check. Also, ensure your base URL doesn’t have a trailing slash if your ID starts with one. That creates // which might be valid but breaks downstream logic.