Hello Developers…
Need your assistance to achieve LinkedIn Learning Report JSON to CSV.
Objective:
LinkedIn learning report download API call
Received JSON response to CSV
JSON response | Below is 1 item, simarly have some 90 items in the response file:
{“paging”:{“start”:0,“count”:1000,“links”: ,“total”:90},
“elements”:[{
“learnerDetails”:
{“name”:" “,
“enterpriseGroups”: ,
“email":"sample@email.com ”,
“entity”:
{“profileUrn”:“urn:li:enterpriseProfile:(urn:li:enterpriseAccount:11111111,222222224)”},
“uniqueUserId”:”",
“customAttributes”:{}},
“activities”:[
{“engagementType”:“SECONDS_VIEWED”,
“firstEngagedAt”:1597931100000,
“lastEngagedAt”:1597934700000,
“engagementMetricQualifier”:“TOTAL”,
“engagementValue”:912,“assetType”:“COURSE”},
{“engagementType”:“PROGRESS_PERCENTAGE”,
“lastEngagedAt”:1597934700000,
“engagementValue”:22,“assetType”:“COURSE”}],
“contentDetails”:
{“name”:“HR and Digital Transformation”,
“contentSource”:“EXTERNAL”,
“contentUrn”:“urn:li:lyndaCourse:756286”,
“locale”:
{“country”:“US”,
“language”:“en”}}},
Tried with below:
Used custom activity, but got all the data in single row
Deserialize JSON array didn’t work, because it says at the starting of the JSON file is not an array.
Deserialize JSON, it worked, but when I use for each with JSON Object and argument type as JObject, it says “object reference not set”
One of the code snippet, which I tried:
Please assist.
Thank You.
Regards,
Rajesh Attada
Finding my Path → Using UiPath
Nithin_P
(Nithin Prabhu)
September 7, 2020, 11:49am
2
Hello @Rajesh.Attada01 ,
Looks like you have posted an extract of the JSON here. Could you please post the exact JSON in a text file (With atleast 2 records).
Regards,
Nithin
1 Like
Nithin,
Firstly, thank you so much for coming forward to assist me.
This means a lot.
PFA for the LinkedIn_Learning_Report_Download_APICall_JSON_Response fileLinkedIn_Learning_Report_Download_APICall_JSON_Response.txt (4.0 KB)
Attached JSON file contains couple of learnerDetails as you requested.
Names, email-ids and group names are changed to achieve compliance issue.
Thank You.
Regards,
Rajesh Attada
Finding my Path → Using Uipath
1 Like
SowmyaLeo
(Sowmya Sivakumar)
September 8, 2020, 11:32am
4
Hi,
Please try the following:
After deserialize Json activity, get the JObj(“elements”) to a string.
Deserialize the Json array from the string above and then try extracting the learnerDetails.
1 Like
Sowmya,
Thank You so much for coming forward to assist me.
About JObj(“elements”) to a string, is it with a assign activity?
String = JObj(“elements”)
Also Extracting learnerDetails, is it like below?
For each item of JArray(“learnerDetails”)
{
Item(“name”).Value
Item (“email”).Value
And so on
}
Please assist.
Thank You.
Regards,
Rajesh Attada
Finding my Path —> Using UiPath
Sowmya,
I can’t express my happiness.
You made my day
Finally I see some output, now understood a bit on how to read data from JSON.
From here I will explore on how to get my relevant data to a datatable and write it to CSV.
Can’t forgot your help.
Thank You so much
Regards,
Rajesh Attada
Finding my Path → Using Uipath
1 Like
SowmyaLeo
(Sowmya Sivakumar)
September 9, 2020, 12:42pm
8
Glad I was able to help Good luck and Happy automation…
1 Like
Thank you so much Sowmya
Great help
Regards
Rajesh Attada
Finding my Path → Using Uipath
system
(system)
Closed
September 12, 2020, 6:07pm
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.