flatenjsondemo
Reactive icon

FlattenJsonDemo

version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 1 Aug
 by 
TheLoCos
5.0
 (1 rating)
flatenjsondemo

FlattenJsonDemo

Details
This asset is an extension and logic that uses the Newtonsoft. Json library to flatten a nested JSON object into a dictionary of key-value pairs. This approach is useful for scenarios where you need to process or store JSON data in a flat structure, such as logging, data analysis, or sending it to systems that don't support nested objects.
Read more

The core logic is in the Flatten method, which recursively traverses the JSON. It handles JSON objects by appending property names to the key and JSON arrays by appending the index. When it reaches a simple value (like a string, number, or boolean), it adds the generated key and the value to the dictionary.

You can run this code to see how the sample nested JSON is transformed into a flat key-value pair format. You can easily adapt this by replacing the sample nestedJson string with your own JSON data.

There is also Logic created to convert the Flatten Json in to an Array as required.

Release notes (1.0.0)
License (1.0.0)
Reviews (0)
Team
Other assets in this category