Unable to access results value
I am encountering an error when accessing the properties of a scripts results.
As you can see on the right side under results, the snow_ticket.error does in fact exist. Yet I'm getting the following error:

18 Replies
try results?.snow_ticket?.error
tried that too. same result
I even tried ${results.snow_ticket?.error || 'N/A'}
can you send me your full expression please
Hey @rubenf, were you able to look in to this? thanks
I wasn't able to reproduce:
can you send me a similar extremely minimal flow with your issue please
sure thing
ok I reproduced the issue:
so in the inline script if i return the object without the try/except, it works fine. but once i add a try/except i get the error:
its like the return type cant be inferred and confuses the system?
but when i add a return value i.e string in the try block in the inline script, it works
in what you gave, you're not returning anything in step
a
this will just passyes there are some scripts to where i only returned something if error. else none
sure but then it's normal
results.a.error errors
results.a is null as the error indicatei assumed the ts expr would return 'undefined' if snow_ticket?.error was null?
maybe but that's not the reproduction you sent
apologies. I noticed that if i did not include a return of something in the above script and attempted to use a nested property of the result of the script, then it would give me the error
it gives you the error that results.a is null which it is
and if you use results.a?.error it will work
I need a reproduction where the engine is not working as intended, not where the error is the same but it's intended
correct. but i was hoping that the question mark (null-aware) would handle the possibility of the returned value being null
it does
the reproduction needs to show a case where it doesn't
because even including the ? it was still giving me the error.
removed the returning value from try block
updated branch predicate to "results.a?.error == null" and it gives me
Ok I can indeed reproduce, on it, thanks
found the issue, fixed on latest commit. latest will be available to pull in 20mins and we will do a release and deploy tomorrow.
Awesome! Appreciate the help!