cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Looking for the correct syntax for the Path Expression in the Query JSON action

Jump to solution

I cannot figure out what the correct syntax should be for the path expression in the Query JSON action.

This is my sample data:

2020-07-21_18-00-46.jpg

 

When I parse the userCreated it returns nicely John into my variable:

2020-07-21_18-02-30.jpg

 

But this is the one I actually need: The id of the first element of mediaItems. So I use mediaItems/(0)/id:

2020-07-21_18-01-53.jpg

 But this returns an error:

2020-07-21_18-18-45.jpg

 

Questions:

  1. What is the right syntax?
  2. Where is this explained/described?
Labels: (1)
Tags (1)
0 Kudos
Reply
2 Replies
Highlighted
Community Manager Community Manager
Community Manager

Re: Looking for the correct syntax for the Path Expression in the Query JSON action

Jump to solution

@woutert I know that in NWC we use JSONPath syntax, and believe that the correct syntax would be: $.mediaItem[0].id.

 

I tested this on JSONPath Online (https://jsonpath.com/) and it looks to come back correctly while mediaItems/(0)/id finds no match:

JSONPath.png

NoMatch.png

 

Let me know if that works.

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: Looking for the correct syntax for the Path Expression in the Query JSON action

Jump to solution

Thanks!!! Very much appreciated the time you spent to even test your solution for me. It works like a charm.
Hey Nintex, a reference link or a few basic examples in the help file or for the action would really help a lot. Even a link in the error message would have saved me a lot of time.

0 Kudos
Reply