cancel
Showing results for 
Search instead for 
Did you mean: 

JSON file

aseelodeh
Level 5
hello, can you advise me on a way for extracting data from JSON file(which is an OCR extraction of an image), I need only  the text pieces of information without other image components, please notice that convert JSON to a collection is not working well for multi-level arrays, and it only extracts the first array in 1 row

------------------------------
aseel odeh
------------------------------
8 REPLIES 8

ewilson
Staff
Staff
Hi @aseelodeh,

To be clear, you have a JSON structure that was created from an OCR review of an image, correct? I assume when you say "JSON to a collection is not working" you're referring to the use of the Utility - JSON VBO? Can you post an example of the JSON in question?

Cheers,


------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

EmersonF
MVP
Hi. @aseelodeh, you're fine?
Why do you need to capture an image?
I use this JSON Parser - VBO and it works very well, even with multi-node structures, I use this JSON to Collection action (skipping JArray)
follow the link below containing XML from VBO, save as xml file and import into BP, test and if possible return me if this also worked for you

VBO: JSFiddle - Code Playground

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

Thanks for quick response, this is an example of JSON, it's a retrieved  information from API, and this is an object of several levels which needs nested collections however it only extracts the first array in a nested collections and each of them have only 1 row, and yes I tried "JSON VBO" and also "Symphony Ventures - JSON Manipulation" 

9499.png


------------------------------
aseel odeh
------------------------------

@aseelodeh, Could you post in text so you can test here? I believe I can have the solution​

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

yes sure , 

{"language":"en","textAngle":0.0,"orientation":"Up","regions":[{"boundingBox":"187,76,44,10","lines":[{"boundingBox":"187,76,44,10","words":[{"boundingBox":"187,76,15,10","text":"iAX"},{"boundingBox":"204,76,27,10","text":"Invoice"}]}]},{"boundingBox":"247,215,17,130","lines":[{"boundingBox":"247,215,17,7","words":[{"boundingBox":"247,215,17,7","text":"Lum"}]},{"boundingBox":"247,338,16,7","words":[{"boundingBox":"247,338,16,7","text":"aun"}]}]},{"boundingBox":"275,300,11,9","lines":[{"boundingBox":"275,300,11,9","words":[{"boundingBox":"275,300,11,9","text":"1.11"}]}]},{"boundingBox":"291,31,147,490","lines":[{"boundingBox":"357,31,78,15","words":[{"boundingBox":"357,31,39,15","text":"öL»Jl"},{"boundingBox":"398,35,37,11","text":"J.i.n.o"}]},{"boundingBox":"357,47,78,10","words":[{"boundingBox":"357,47,37,8","text":"masdar"},{"boundingBox":"397,47,8,8","text":"al"},{"boundingBox":"408,47,27,10","text":"hayat"}]},{"boundingBox":"392,363,11,7","words":[{"boundingBox":"392,363,11,7","text":"i.re"}]},{"boundingBox":"421,375,17,7","words":[{"boundingBox":"421,375,17,7","text":"31.26"}]},{"boundingBox":"291,511,84,10","words":[{"boundingBox":"291,511,53,8","text":"tvstmer'aneA"},{"boundingBox":"346,511,29,10","text":"Shotre"}]}]}]}

------------------------------
aseel odeh
------------------------------

@aseelodeh, i Removed this line {"language":"en","textAngle":0.0,"orientation":"Up","regions":[{"boundingBox":"187,76,44,10","lines": and the last "}" and return this 
9502.png


------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

Good, I need only the last collection called "Lines" of each row, how can I get it?

------------------------------
aseel odeh
------------------------------

You can run a loop by accessing the values, example: [Lines.words.Lines] to get the value, you just need to create logic to check how many lines there are and run for it

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil