Document understanding Dataset output to xml and Json format

Hi everyone,
I have extracted data fields from pdf using Document Understanding OCR’S and out stored in dataset format . Can dataset be written to xml and json fromat as output
let me know can any one have idea.
advance Thanks,

Hi @Bharath_Kumar_B ,

We could Convert the Dataset into a Json String using the Below Expression :

strJsonDS = Newtonsoft.Json.JsonConvert.SerializeObject(datasetVar)

Now, we get the Json String, and using that we could convert to Xml as below :

strXmlDS = NewtonSoft.Json.JsonConvert.DeserializeXNode(strJsonDS,"Table")

Do note that, “Table1” is the Root Element of the strJsonDS string.

We would need to add a Top Root Element for the Xml, so we add it as "Table"

@Bharath_Kumar_B From the data set get the tables (form of data table) and convert required data table to json using the below query in assign

DTtoJson (which is string) = JsonConvert.SerializeObject(ExportDataset.Tables(0))

  • ExportDataset is the output of dataset and tables(0) is the first table (Change it accordingly) in the data set