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