Hi Guys,
Below is my JsonResponse of type JsonArray and I want to iterate through this using for each loop. Can you please help if you have solved similar kind of problem?
JsonResponse
[{“predictions”:1,“confidences”:0.7164001138},{“predictions”:0,“confidences”:0.845748191},{“predictions”:1,“confidences”:0.6578971967},{“predictions”:0,“confidences”:0.9666104859},{“predictions”:1,“confidences”:0.694211731}]
I want the Output to be be printed for each line as below:
1
0
1
0
1
Also, please see the below screenshot and see what I am missing.
1 Like
Gokul001
(Gokul Balaji)
January 19, 2022, 6:26am
2
Hi @shreyash_shirbhate
Use this Assign acticity inside the For each loop
Use Assign activity
RHS : item.GetValue(“predictions”).ToString
Regards
Gokul
2 Likes
Hi @shreyash_shirbhate
You have to deserialize json for each iteration and print the Jobj(“predections”).ToString to get your desired output
refer below image for more reference
Hope is solves your issue
Update us whether you got your desired solution or not
thanks
Robin
ppr
(Peter Preuss)
January 19, 2022, 9:41am
4
in general the main steps are mentioned above
set the typeargument from for each activity to JObject
retrieve the value with yourLoopVar(YourPropertyName).Value(Of YourDataType) using the preferred Value(Of…) method
e.g.
item(“predictions”).Value(of String) - getting String
or
etc…
1 Like
Thanks @Gokul001 @Robinnavinraj_S @ppr .
All the solutions you guys gave are working fine.
1 Like
system
(system)
Closed
January 22, 2022, 9:48am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.