After deserialize Json from orchestrator string, can not retrieve specific content from a particular ref

Hello everyone.

Using “Http Orchestrator Request activity”, I get the items filtered as I need, then deserialized them, and I get the info I want.

But I want to call an specific content using the reference number, I can get the info using the index, but I couldn’t find the way to use the reference number after some trys and documentation, screenshot attached with the info I retrieved and the whole info using the select token “value”:

image

What I am trying to do is instead using the index, call directly the entry with an specific reference number

Thank you for your time!

If we got your request right, you are looking for the endProcessing Value of a particular QueueItem by using the Reference, right?

give a try on

SelectToken("$.value[?(@.Reference == ‘YourReference’)].EndProcessing")

otherwise we can also use LINQ

1 Like

Thank you, but it doesnt work.

My url for the get, filtered by status, and dates: urlorchestrator+QueueItems?%24filter=Status%20eq%20’Successful’%20and%20StartProcessing%20ge%202021-08-25%20and%20EndProcessing%20le%202021-09-03&%24select=Reference%2C%20StartProcessing%2C%20EndProcessing"

Here is the full object in string format:

@"{
“”@odata.context"": ““urlfromorchestrator/$metadata#QueueItems(Reference,StartProcessing,EndProcessing)””,
“”@odata.count"": 7,
““value””: [
{
““Reference””: "“49477"”,
““StartProcessing””: ““2021-08-26T11:51:56.517Z””,
““EndProcessing””: ““2021-08-26T11:51:56.89Z””
},
{
““Reference””: "“50069"”,
““StartProcessing””: ““2021-08-26T11:53:21.33Z””,
““EndProcessing””: ““2021-08-26T11:53:21.657Z””
},
{
““Reference””: "“49755"”,
““StartProcessing””: ““2021-08-26T11:53:22.493Z””,
““EndProcessing””: ““2021-08-26T11:53:22.9Z””
},
{
““Reference””: "“50084"”,
““StartProcessing””: ““2021-08-26T11:53:23.573Z””,
““EndProcessing””: ““2021-08-26T11:53:24.59Z””
},
{
““Reference””: "“50212"”,
““StartProcessing””: ““2021-08-26T11:53:25Z””,
““EndProcessing””: ““2021-08-26T11:53:25.263Z””
},
{
““Reference””: "“50236"”,
““StartProcessing””: ““2021-08-26T11:53:25.687Z””,
““EndProcessing””: ““2021-08-26T11:53:26.077Z””
},
{
““Reference””: ““50347"”,
““StartProcessing””: ““2021-09-01T16:34:53.127Z””,
““EndProcessing””: ““2021-09-01T16:51:48.44Z””
}
]
}”

ok will check it , give me a little time

1 Like

Hi @Alberto_Palma ,

You can also use it as shown below

image

Instead of putting in dictionary you can store values in string or dt as per your requirement.

Attaching file for your referencejsonGetData.xaml (7.7 KB)

1 Like

One thing that you can try

arrMatches | JObject() = YourOBJ_Result(“value”).Values(Of JObject).Where(Function (x) x(“Reference”).Value(of String).Equals(YourRefID)).toArray

depending of it was found (arrMatches.Count = 1) we can grab the value by
arrMatches (0)(“EndProcessing”)…

1 Like

Thank you, making a dictionary is the best solution.

Besides I’d play with the query to get ordered by reference

Thank you for your time.

1 Like

I couldnt make it run :frowning:

@Alberto_Palma
was working at my end:

what was done / implemented by you?

also SelectToken looks fine:
grafik

1 Like

I quite like more your solution, and yes it works!
image

Thank you!!

check the dot between toarray.First() vs the minus used in your statement
Ok now fixed in youre statement

1 Like

I just finded the issue and edited the reply :sweat_smile:

Thank you so much!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.