How to copy Json Response to an array /Data Table

Hi ,
Can any one please help me I need to copy my json response into an array or data table.
Input :

“{”“vinNumber”“:[”“JHLRD28411C002633"”,““5TDZA23C25S346688"”,”“2GTEC19T631317807"”,““5YFBU4EE4DP200920"”]}”

Output : my output is in a string
“{”“vinNumber”“:”“JHLRD28411C002633"”,““status””:““valid””},{““vinNumber””:““5TDZA23C25S346688"”,”“status”“:”“valid”“},{”“vinNumber”“:”“2GTEC19T631317807"”,““status””:““valid””},{““vinNumber””:““5YFBU4EE4DP200920"”,”“status”“:”“valid”“}”

when I am trying deserialize my output string I am getting below error.
image

Finally I need to copy my data into array or into a data table.

Please help me how can achieve this.

@prasanna.Ui you could try https://activities.uipath.com/docs/deserialize-json or https://activities.uipath.com/docs/deserialize-json-array, loop through the output of that, and fill your datatable

In your Deserialize json activity, set the TypeArgument Property to System.Data.DataTable and the Output JsonObject should be a variable of type System.Data.DataTable.

An alternative to this would be to:

  1. Use a Build Data Table activity to create a new data table
  2. Use a For Each to iterate through your array
  3. Use an Add Data Row inside the For Each to add each row to the data table

Hi.

This is just from my understanding, but you need to first use Deserialize Json to create json object, then you can use Deserialize Json Array to create an array for each key.

To do specifically the “vinNumber” key, then you can hardcode it, but if you need multiple keys then you would need to use a For Each.

It should look like this:
image

Then, you can run that array through a For Each to add the values to a Data Table as was mentioned.

Hello,
In this video I do a lot of stuff with JSON and I create also DataTable 17:50 :

Thanks,
Cristian Negulescu