Deserialize CSV to Data Table

Hi

Can any help to deserialize CSV to Data table. And in CSV Sheet cell B2. the data is available in JSON format.

Screenshot -

I used deserialize JSON & Deserialize JSON array activities to perform but getting errors. and unable to write it in Data Table.

Attaching an screenshot for output reference.

Hi @Naman_Arora

Please provide the Json Data

Regards

Hi @Naman_Arora

Provide the sample input file

@pravallikapaluri

yes here it is
sample input 2.xlsx (8.4 KB)

@vrdabberu

Here is the JSON data, which is available in cell B2 in CSV sheet.
csvjson.json (543 Bytes)

Regards
Naman

For conversion of the JSON into a DataTable we can do:

Hi @Naman_Arora

Can you try the below

Sequence5.xaml (11.7 KB)

sample input 2.xlsx (8.9 KB)

Cheers!!

Hi @Naman_Arora

Please check the below workflow:
Main.xaml (19.4 KB)
sample input 2.xlsx (9.0 KB)

Regards

@vrdabberu

Hi

I want to deserialize the cell B2 in CSV. I used Read CSV activity then I created a variable using assign activity which will read cell B2 value. However I still getting errors when I using deserialize JSON activity after that.

Regards
Naman

@vrdabberu

I understood the concept behind deserialize but my concern is to read a CSV and particular cell value which is available in json format and deserialize it into a new data table.

Hi @Naman_Arora

Please use the below workflow:

Main.xaml (19.7 KB)

REGARDS

as we had shown a working JSON to DataTable conversion it would be necessairy to tell us directly

  • what was done
  • which error occured

@vrdabberu

When I tried to run the workflow you shared. I made some changes according to the data I have. So data is in cell K2 in CSV.

I have change the expression to read K2 - dt1.Rows(1)(10).ToString

But I’m getting this error.

image

Hi @Naman_Arora

In the read csv activity if you have given the has headers as true then please give the below syntax:

dt1.Rows(0)(10).ToString

If you didn’t gave the has headers as true then please use the below syntax:

dt1.Rows(1)(10).ToString

Regards

@Naman_Arora

index of row start from 0 and not 1 …also column index also starts from 0 and not 1

so dt1.Row(0)(10).ToString

As Per error it says there is no second row

cheers

@vrdabberu

Thank you so much. it worked finally.

Hi @Naman_Arora

If you find the solution please do mark as solution to close the loop.

Regards

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