Project.json like Structure - JSON Transformation into DataTable

Is it possible to convert to a datatable, if the Json structure is unknown?

Consider this example json data:
{
“name”: “test-api”,
“expressionLanguage”: “VisualBasic”,
“entryPoints”: [
{
“filePath”: “Main.xaml”,
“uniqueId”: “236225b7-396d-49d0-a602-628269d13988”,
“input”: ,
“output”:
},
{
“filePath”: “Main-UPDATE POs.xaml”,
“uniqueId”: “6e4501d0-165e-451d-947f-e868b215fbb5”,
“input”: ,
“output”:
},
{
“filePath”: “TEST_Azure_Pull A PO.xaml”,
“uniqueId”: “124f651b-274a-43e0-a849-cee13685b56c”,
“input”: ,
“output”:
}
],
“isTemplate”: false,
“templateProjectData”: {},
“publishData”: {},
“targetFramework”: “Legacy”
}

I’d like to traverse through this structure and find out what type each key:value pair belongs to, such as String, Object, Array etc., and drill down beneath a child object or array, until all objects/array have been determined to the string value level.

The goal is to convert any JSON data file into data table, simply by reading it and converting the entire file into a datatable.

If this exercise was successful, I’d like to see the following:
“name” = “test-api”
“expressionLanguage” = “VisualBasic”
“entryPoints.filePath” = “Main.xaml”
“entryPoints.UniqueId” = “236225b7-396d-49d0-a602-628269d13988”

etc

@csathys

Its basically similar to flattening a array of arrays

The idea is to loop through each key…and check the type of the value inside that key…if type is jarray …then loop as array and get values…type as string then stop traversing…if type a jobj then traverse through keys again

This si the logic to be implemented

Cheers

I sure understand the logic. I was looking for some ideas on how to implement that since the structure is unknown. An array could have multiple levels of objects and arrays. Similarly, an Object could have multi-level arrays and objects.

Another example:
{
“name”: “test-api”,
“description”: “Blank Process”,
“main”: “test-api.xaml”,
“dependencies”: {
“UiPath.Excel.Activities”: “[2.11.4]”,
“UiPath.Mail.Activities”: “[1.12.3]”,
“UiPath.PDF.Activities”: “[3.16.0]”
},
“webServices”: ,
“entitiesStores”: ,
“schemaVersion”: “4.0”,
“studioVersion”: “21.10.4.0”,
“projectVersion”: “1.0.6”,
“runtimeOptions”: {
“autoDispose”: false,
“netFrameworkLazyLoading”: false,
“isPausable”: true,
“isAttended”: false,
“requiresUserInteraction”: true,
“supportsPersistence”: false,
“excludedLoggedData”: [
** “Private:*”,**
** “password”**
** ],**
“executionType”: “Workflow”,
“readyForPiP”: false,
“startsInPiP”: false,
“mustRestoreAllDependencies”: true
},
designOptions”: {
“projectProfile”: “Developement”,
“outputType”: “Process”,
"libraryOptions": {
** “includeOriginalXaml”: false,**
** “privateWorkflows”: **
** }**,
“processOptions”: {
“ignoredFiles”:
},
“fileInfoCollection”: [
{
“editingStatus”: “InProgress”,
“testCaseId”: “a154556a-012d-4ad6-8aae-349d9d51d673”,
“fileName”: “TestCase.xaml”
}
],
“modernBehavior”: false
}
}

In this example, notice designOptions, which has another object within it. In a complex situation there could be multiple objects one with in another. Same within an array as well.