<div dir="ltr">Awesome, thanks for the additional info!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 30, 2020 at 6:58 PM Anthony Holloway <<a href="mailto:avholloway%2Bcisco-voip@gmail.com">avholloway+cisco-voip@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I had this typed up, but then got pulled away. I see now that Tan-the-man already replied, but I will still hit send anyway.</div><div><br></div>I use the following jsonpath tester, since it's based on the jaway implementation, the same as UCCX.<div><br></div><div><a href="https://jsonpath.herokuapp.com/" target="_blank">https://jsonpath.herokuapp.com/</a><br></div><div><br></div><div><div><img src="cid:ii_kd9e9m571" alt="image.png" style="margin-right: 0px;"><br></div></div><div><br></div><div>You can see that the following json path $[0].status works to return delivered. It also works in UCCX:</div><div><br></div><div><div><img src="cid:ii_kd9ecbjf2" alt="image.png" width="471" height="208"><br></div></div><div><br></div><div>$ = the entire thing, and since the entire thing is an array, you can just index it like a normal array in any other language.</div><div><br></div><div>PS To use the String http_resp in the Create JSON Document step, I do this: (Document) http_resp.</div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 30, 2020 at 5:21 PM Brian Meade <<a href="mailto:bmeade90@vt.edu" target="_blank">bmeade90@vt.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Tanner,<div><br></div><div>It looks like your solution should work. I had tried a couple of different ways of trying to get the status from the first Element. I'll give that a try with your JSONPath.</div><div><br></div><div>Thanks,</div><div>Brian Meade</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 30, 2020 at 6:17 PM Tanner Ezell <<a href="mailto:tanner.ezell@gmail.com" target="_blank">tanner.ezell@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">We need to see how you're converting, and how you're querying to give you meaningful help.<div><br></div><div>Quick 5 second POC using your input string:</div><div><br></div><div><div><img src="cid:ii_kd9cyoxi0" alt="image.png" width="562" height="351"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 30, 2020 at 2:29 PM Brian Meade <<a href="mailto:bmeade90@vt.edu" target="_blank">bmeade90@vt.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">This is probably something Anthony knows off the top of his head but at least we'll get his answer archived.<div><br></div><div>I've got a UCCX Script doing a REST Call and the response JSON is actually an array (indicated by the square brackets) even though it's only one response. The resulting String looks like this:</div><div>U"[{\"status\":\"Delivered\"}]"<br></div><div><br></div><div>Converting this into a Document then JSON Document seems to not work properly because of this bracket issue. The JSON Document ends up looking like this:</div><div>TEXT[[{\"status\":\"Delivered\"}]]"</div><div><br></div><div>The GET JSON Document Data step then fails to find anything using the JSONPath.</div><div><br></div><div>To work around it, we used substring to remove the set of square brackets around the original response string before converting to a Doc which works and resolves the issue but I'm thinking there's gotta be a better solution. </div><div><br></div><div>I imagine many JSON responses are probably going to contain arrays. In this case, we're always getting a single result but I can imagine this would be an issue where the REST step actually comes back with multiple items in the array.</div><div><br></div><div>Any ideas?</div></div>
_______________________________________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" rel="noreferrer" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a><br>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" rel="noreferrer" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a><br>
</blockquote></div>
</blockquote></div>