Why does this processor.alan
compile…
... => {
let $'line' = $ => parse as JSON => decorate as {
...
'shippingLine': optional {
'title': text
}
} || throw "Order json line could not be parsed"
execute ^ ^ ^ ^ ^ $'Context':'Add Order' with (
...
'Shipping service name' = $'line'.'shippingLine' get .'title' || "no shipping service provided"
)
}
… but do I only receive values “no shipping service provided” (while I know values exist)?
I guess the get
is misused here…?
This should work as expected, the get
here is used correctly.
A trick you can use here to validate the data is to assign $
to a let
.
When stack-traces are produced, the value of $
is not included as this often remains the same between statements, but all let
values (which where successfully evaluated) are included.
In this specific case, changing the alternative to a throw
would generate a stack-trace with the textual version of the JSON included.
Thanks.
Unfortunately, I have to admit I simply forgot to add the node shippingLine
and element title
to the query that fetches the data.
The lines of code presented in my previous post are part of the processor.alan
where the result of the query is processed. The query is further upstream in the file and not shown here.