LinkedIn Learning Report Download API -> JSON to CSV

Hello Developers…

Need your assistance to achieve LinkedIn Learning Report JSON to CSV.

Objective:

  1. LinkedIn learning report download API call
  2. 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:

  1. Used custom activity, but got all the data in single row
  2. Deserialize JSON array didn’t work, because it says at the starting of the JSON file is not an array.
  3. 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:
image

Please assist.

Thank You.

Regards,
Rajesh Attada


Finding my Path → Using UiPath

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

Hi,

Please try the following:

  1. After deserialize Json activity, get the JObj(“elements”) to a string.
  2. 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

  1. Deserialize Json activity (The one you already have )
  2. Deserialize Json Array activity - The Json String will be Response(“elements”).ToString - save the output to the Json Array variable
  3. ForEach Item in JsonArrayVariable - item will be of type JObject
    item(“learnerDetails”)(“name”).ToString - to access the name
2 Likes

Sowmya,

I can’t express my happiness.
You made my day :smiley:

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 :handshake:

Regards,
Rajesh Attada


Finding my Path → Using Uipath

1 Like

Glad I was able to help :slight_smile: Good luck and Happy automation…

1 Like

Thank you so much Sowmya :blush:
Great help :handshake:

Regards
Rajesh Attada


Finding my Path → Using Uipath

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