iZan
January 5, 2022, 7:07pm
1
Hello,
I have a simple task to complete but I have some problems with it.
I am calling API (https://date.nager.at/Api/v2/PublicHolidays/2022/SI ) to receive data (JSON) regarding public holidays. I deserialize JSON (Json.Linq.JArray) normally but later on in For Each I have some issues getting data only from the “date”. I would like to loop through all the “date” entries. How can i accomplish that?
Thank you,
Žan
ppr
(Peter Preuss)
January 5, 2022, 7:33pm
2
@iZan
Welcome to the Forums
Have a Look on the deserialize JArray activity
Give a try in setting the for each typeargument to JObject and Loop over the different Array items.
Access the Date With Item(“date”).value(of String) to get Back the Date as String. Or use value(of DateTime) for retrieving it as a DateTime
1 Like
Hi @iZan
Please find the attached xaml file, i developed a workflow as per your requirement
Json(Autosaved).xaml (9.3 KB)
Hope its solves yours issue
Thanks,
Robin
1 Like
iZan
January 5, 2022, 11:33pm
4
Perfect! @ppr and @Robinnavinraj_S , both solutions are working! Thank you for your time.
Bottom line
Solution file
GetPublicHolidays.xaml (9.9 KB)
ppr
(Peter Preuss)
January 5, 2022, 11:39pm
5
Perfect. May we ask you for Marking the solving Post solution. So Others can benefit from IT. Thanks
Forum FAQ - How to mark a post as a solution
This document is part of our beginners guide .
This article will teach you how to properly mark a post as a solution.
We were closely following our last UiPath Forum feedback round! topic and carefully extracted all the bits of feedback that was provided. As such, we would like to tackle the topic of solutions on our Forum and how to properly use them.
When is the topic resolved?
The topic can be considered resolved when the topic author has fo…
system
(system)
Closed
January 8, 2022, 11:39pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.