aleix.vaz Posted December 11, 2019 Share Posted December 11, 2019 Hi,I have the following JSON file from which my data adapter is reading and I would like to do a Query and select an object depending on its "id".[ { "id":"bugcorrection", "name":"Bug Correction Throughput", "description":""Density of errors that were corrected within the defined duration threshold"", "value":0.5, "value_description":"0,50", "date":"2019-09-19", "datasource":null, "rationale":"parameters: {totalCommitsRelatedToIssue=0, lastSnapshotDate=2019-01-01, ...", "forecastingError":null }, ... { "id":"bugidentification", ... }][/code] My idea is to do something like (id == "bugcorrection") to get this single object from the array. Is there any way to do it? I've seen some examples but non of them is what I'm asking, and tbh I'm quite new to jasper...Thanks in advance, Link to comment Share on other sites More sharing options...
trvpseudo Posted December 12, 2019 Share Posted December 12, 2019 XD Link to comment Share on other sites More sharing options...
Solution narcism Posted December 12, 2019 Solution Share Posted December 12, 2019 If you are able to switch to JSONQL language, you could use a query like: *(id == "bugcorrection")The original JSON language is very limited in terms of tree traversal and is meant to be replaced by JSONQL. Link to comment Share on other sites More sharing options...
aleix.vaz Posted December 12, 2019 Author Share Posted December 12, 2019 Thanks! Switching to JSONQL was the solution, "due to its extended capabilities of traversing and filtering JSON structures" as you said in the Sample Reference. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now