cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Form Recognizer json output problem

Hi all,

 

I am currently trying to extract data from a PDF file with Microsoft Form Recognizer whenever

a file is uploaded on my Sharepoint site.

The extracted data shall be added to the original file as Metadata.

Everything worked quite fine besides the usage of the template language expression to use the JSON output from Form Recognizer to find the adequate key - value pairs and add their data to the PDF.

 

The JSON output from Form Recognizer looks like this:

grafik.png

 

My Flow looks like this:

grafik.png

In update file properties I try to get the data from JSON via the expression:

It seems to be working because I do not get an error anymore but the metadata field is empty.

 

body('Parse_JSON')?['pages'][0]?['Datum:']?['value']

 

if I try any other Index than [0] I get this error and I do not understand why:

grafik.png

To be honest I do not really understand the template language expression and how to iterate through an array.

Additionally it does not make too much sense for my purpose because I wanted to be able to

analyze documents with another format as well. Whenever the key - value pair I want to extract is in another line it would not 

work if I work with Indexes.

 

I would appreciate any help.

 

Best regards,

AdriP

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Form Recognizer json output problem

HI @AdriP 

 

The error that you're getting is that to access one item in the array but it's empty. You can check the JSON to see if you have, bellow Datum a value with [] and values within. 

 

To iterate between each you can use the "For Each" and use the array as follows:

Screenshot 2020-01-08 at 11.51.02.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel 

View solution in original post

1 REPLY 1
Highlighted
Super User II
Super User II

Re: Form Recognizer json output problem

HI @AdriP 

 

The error that you're getting is that to access one item in the array but it's empty. You can check the JSON to see if you have, bellow Datum a value with [] and values within. 

 

To iterate between each you can use the "For Each" and use the array as follows:

Screenshot 2020-01-08 at 11.51.02.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,847)