Extract data Json to Excel

Hi Sir , im new in UiPath and i get some problem to extract data from Json to Excel , and i really need your help

1 Like

Hi @abdouaziz

I made this private message public for our community to help you out. But first, please edit your first post so that it contains more information so that other community members have some context.

I wanted to save the data from the json file below in an excel file

{
“datelivrance”: “5/2/2014”,
“type_id”: “SN_1”,
“sexe”: “M”,
“nom”: “CISSE”,
“datexpiration”: “5/2/2024”,
“taille”: “170”,
“lieudenaissance”: “SEGRE SECCO”,
“adresse”: “PLLE N’699 RUE 387 ARAFAT GYOFF”,
“image_id”: “”,
“prenom”: “ELHADJI ALIOU”,
“datedenaissance”: “01/01/1987”,
“cni”: “1497 2013 01535”,
“status”: “ok”
}

enreg

when I launch this workflow, I have as a result the json

{
“datelivrance”: “5/2/2014”,
“type_id”: “SN_1”,
“sexe”: “M”,
“nom”: “CISSE”,
“datexpiration”: “5/2/2024”,
“taille”: “170”,
“lieudenaissance”: “SEGRE SECCO”,
“adresse”: “PLLE N’699 RUE 387 ARAFAT GYOFF”,
“image_id”: “”,
“prenom”: “ELHADJI ALIOU”,
“datedenaissance”: “01/01/1987”,
“cni”: “1497 2013 01535”,
“status”: “ok”
}

, now I want to save this data in an Excel file

@abdouaziz

in general it could look like this (assumed we do process this type of structure)

  • JSON was deserialized into variable JsonObject
  • we do iterate over each property
    • adding a column to a datable of datatype string with name same as property name
    • adding the value of the property to a string list
  • adding the listValues to the datatable
  • writing the datatable to Excel

Demo XAML here
abdouaziz.xaml (7.2 KB)
JSON Sample here
Data.json (338 Bytes)

for running the demo download the files into your project and rewire the paths (JSON, EXCEL) to your File / directory paths

Let us know your feedback

2 Likes

Thank you for your response and the files to use it I am really grateful

Perfect so if it is working close the topic with solution flagging the solving answer. In case of open questions we are here for you

1 Like

Thank you for your response and the files to use it I am really grateful

Just a question before closing it, if I want to keep the data in the file to add more? how to do it, because every time he erases the A1 to write there again?

ensure that all lines are in the same structure and use append range instead of write range

1 Like

Its walking, thanks again for everything. god bless you

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