You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I pass last few day to troubleshouting my expressions and i doesn't find any solution or workaround to this case, i'm starting to think that their is a bug somewhere.
I use try.jsonata.org sandbox to troubleshoot and reproduce this case.
Goal of the code:
I'm looking for replace "natureTravaux" string by human readable string from a dict. After translation, result is encapsulated in a array.
As you can see, {...}."myString" and {...}.$var doesn't give the same résult even if $var == "myString".
I tried to encapsulated $var with () or [] to forced $var to be computed before accessing, i rewrite complete logic many time but i can't return $var key value on this dict.
Can you help me to find if either JSONata or me is the probleme ?
The text was updated successfully, but these errors were encountered:
Without any context besides your title, "$var can't be use as accessor of a dict", I would say, yes it can by using the $lookup function:
$lookup($dict,$var)
But when I look at your example, I'm not totally sure about the algorithm you're trying to implement. But based on what I'm seeing I'm going to suggest you use the transform operator. Try this.
JSONata: 2.0.5
I pass last few day to troubleshouting my expressions and i doesn't find any solution or workaround to this case, i'm starting to think that their is a bug somewhere.
I use try.jsonata.org sandbox to troubleshoot and reproduce this case.
Goal of the code:
I'm looking for replace "natureTravaux" string by human readable string from a dict. After translation, result is encapsulated in a array.
This is my simplified json data:
This is my target result:
This is my code that illustrate the issue:
This is the output of the previous code:
As you can see, {...}."myString" and {...}.$var doesn't give the same résult even if $var == "myString".
I tried to encapsulated $var with () or [] to forced $var to be computed before accessing, i rewrite complete logic many time but i can't return $var key value on this dict.
Can you help me to find if either JSONata or me is the probleme ?
The text was updated successfully, but these errors were encountered: