I thought I had this working correctly, but getting some unexpected results while looking at the trace.
I’m looking up an account with query for one object.
I’m storing the results as custom.organization
In the next step, I have render text and store which has the only perform action set as custom.organization.id == null which then stores the results (the value of ‘True’) as global.IsDefaultOrg
The expectation is that if it FOUND an account, then the second step shouldn’t fire (because custom.organization.id != null), and therefore, global.IsDefaultOrg would also be null, because it wouldn’t be set.
Yet, the step is still firing.
I tested it with both a found org and a nonfound org and the step fires each time, when I believe it should be skipped if found.
What’s wrong with the custom.organization.id == null that it’s evaluating to true?
After doing some more testing, I understand what’s happening:
For some email, the company actually is the default org. In this case, the custom.organization.id = 0
I was expecting the operation == null to be evaluating against a true null value, but its treating this as true since the value = 0.
empty string, null and 0 are different things, but they can be treated as synonymous by the developer for different purposes and I think that’s what’s happening here (and hopefully you will confirm).
As an aside –
After working with the syntax for a bit, it looks like everything winds up being strings (since even the command is called ‘render to string’), but then sometimes numeric values can be stored and must be being converted back to an int, otherwise you couldn’t match on numbers being used for IDs on various AT objects.
I’ve worked around this a bit when I want a boolean. I’ll render a variable as “True” and then check “is not empty” when I want to take an action, effectively giving me the same results.