Issue with converting excel data to JSON using jsonConvert.SerializeObject


I am reading an excel file and convert the row by row data in JSON and then send the json payload to a rest call.

When i am converting the excel data to JSON using jsonConvert.SerializeObject then the complete excel data is comverted with proper header tags. However when i am reading row by row by using “for each” while converting by jsonConvert.SerializeObject i am not getting the column names in the converted JSON payload.

Is there any other way to read each record of excel along with column titles and convert it to JSON?

Thanks in advance

1 Like

Hi @Kundan, do you have the xaml file?

Yes I have the xaml and below are the details about it

Please let me know if you need more details.


1 Like

Thanks @Kundan, i am checking.

Hi @Kundan, sorry for the delay!

Try to read the first line of the excel file “header” information separated and merge it into every row.
The idea is to have Headers in a variable being combined with every line in your loop and then converting to Json.

another option :

You can use a BuildDatatable Activity, Including the headers and importing each datarow using .CopyToDataTable() to this datable in order to serialized it. Something like this :

csv-json.xaml (9.0 KB)

Check it and let me know if it works to you.
~Diego Turati