-2

I cannot get form fields values from processing a response in PHP when using a Google Cloud Document AI with a custom processor where the form fields are defined. google-cloud only has documentation for Java, C#, Pyton... How can I get my data? When I tested it in googe-cloud then everything worked...

fields

code

I try to looping over pages en so trying to get formFields but nothing works.

matiaslauriti
  • 7,065
  • 4
  • 31
  • 43
  • Do not post code as images, copy-paste code as text so others can help. Also add a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) – Puteri Dec 09 '22 at 20:32
  • Can you please provide more details. what you want to achieve? P.S - it seems like you operating with wrong Google resource. Based on the code of SDK, i would assume that you need to use this method instead -- getEntities() – Alexander Dyriavin Dec 10 '22 at 07:15

1 Answers1

0

Custom Document Extractor returns the extracted data in the entities field, not formFields.

The Form Parser Processor is currently the only processor that populates the formFields field.


You can use this example to follow the logic for how to handle the response for Entity Extraction processors.

https://cloud.google.com/document-ai/docs/handle-response#entities_nested_entities_and_normalized_values

Holt Skinner
  • 1,692
  • 1
  • 8
  • 21