Introduction
[Looking for a needle in haystack]
When we have a huge chunk of JSON object or collection of JSON objects and have to get the value of a specific property form the JSON, we will need a tool to get us the value extracted or manually use any editor and search for the key and look up its values.
This is a very tedious job and takes more effort for a person to get this job done
Problem Statement
In case of searching for a needle in the haystack, we might have search functionality, however to extract out the values, we must use some sort of regex or other complex mechanism to get the value
Solution
In order to overcome the above problem, I have created a simple application using HTML and Javascript that can get this job done very fast.
Basic understanding of how objects and keys work will be sufficient to get the job done and I am not building something super special, however, we need a tool that can be handy than write a code each time and attempt to fix the errors or make changes in order to extract value.
The following is the limitation of the app
The app does not work with the JSON properties that have array values within keys. This is not something that is impossible, but I am planning to work in this and build it up in the coming days and publish.
Sample JSON
[
{
"user": {
"address": {
"zip": 123
}
}
},
{
"user": {
"address": {
"zip": 456
}
}
}
]
Below is the property path that can be used to extract the
zip codes from the object collection
user>address>zip
Please feel free to use it and let me know in the comments if any changes can be made to make it more useful for the rest of the world.
Let's solve one problem at a time with simple baby steps :)
Comments
Post a Comment