Answered

Format for Get Rest Value query results (json)

I have a GET_REST_VALUE query and am trying to create Keys to extract the results of the returned json values.   My returned values look something like this:


{
"count" : 65,
"dWs" : [ {
"dW" : {
"id" : 56,
"aC" : "J21",
"cc1" : "XX",
"wt" : 1
}
}, {
"dW" : {
"id" : 57,
"aC" : "J22",
"cc1" : "XX",
"wt" : 1
}
}, {
"dW" : {
"id" : 125,
"aC" : "M33",
"cc1" : "XX",
"wt" : 1
}
}, {
"dW" : {
"id" : 99,
"aC" : "DP1",
"cc1" : "XX",
"wt" : 2
}
} ]
}

And I am using something like this to try to extract values.

count
dws.dw.id
dws.dw.aC

 

The count extraction works fine, but the others don't.   What is the correct syntax for this and/or can you  point me at the documentation for it.   When looking at the GET_REST_VALUE docs, the format documentation for this appears minimal.

 

 

0
2 comments
Avatar
William Smith

A quick update on this.   I am using the correct letter case in my testing, but didn't do that correctly in this example.  The correct queries I use are more like:

 

dWs.dW.id
dWs.dW.aC

 

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi William,

You can use a service like this one for finding the path to the node you want to retrieve the value for (minus the X in the beginning of each path). You can paste the response there, then find the path on the right side.

For example, to find the first ID value, you can use "dWs[0].dW.id" which will retrieve 56.

Regards,
Subject7 Team

 

0
Comment actions Permalink

Please sign in to leave a comment.