Hello
I am looking for a JSON filter expression to grab all tokens that “starts with” something.
The expression below does not work:
jobj_JsonObject.SelectTokens("..[?(@.identifier starts with 'Beskrivelse')]").Count
Best regards
Soren
Hello
I am looking for a JSON filter expression to grab all tokens that “starts with” something.
The expression below does not work:
jobj_JsonObject.SelectTokens("..[?(@.identifier starts with 'Beskrivelse')]").Count
Best regards
Soren
Hi @SorenB
Can you try this
jobj_JsonObject.SelectTokens("..[?(@.identifier =~ /^Beskrivelse/)]").Count
Regards,
Hello @lrtetala
Thank you that seems to work
Are you able to explain to me the meaning of the different characters in the expression, so that I can better understand what is going on?
=~
/^Beskrivelse/
Perhaps also:
..[?(@
What does the individual characters represent/mean in the expression?
Regards
Soren
By using regex
=~ /^Beskrivelse/
Uses a regex pattern to match values that start with "Beskrivelse"
. The ^
ensures the match starts at the beginning of the string.
Regars,
Thank you.
I have marked your post as the solution.
lets have shared some more docu and tool resources
Docu:
Initial JSONPath Definition
https://goessner.net/articles/JsonPath/
Newtonsoft Samples:
Future Work / ongoing
Tools
JSONPath Online Evaluator
the JSONPath Support can differ from the Implementation of the Newtonsoft Package. The Newtonsoft Package Implementation is the relevant one, for the UiPath modellings
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.