Get Form Recognizer data into a database

Todd 21 Reputation points

Is there any examples or tutorials for getting the json data from Form Recognizer into a database? Im a newb. Thanks

Azure SQL Database
{count} vote

Accepted answer
  1. YutongTie-MSFT 45,906 Reputation points

    Hello @Todd

    Thanks for using Microsoft Q&A platform . I think you are working on Form Recognizer and you want to export your result into a database.

    For regular models there is no official tutorial about how to export JSON result to DB, but I have found some external resource which can help you.

    Step 1.
    The Azure Form Recognizer SDK for Python provides helper methods like to_dict and from_dict on the models to facilitate converting the data type in the library to and from a dictionary. You can use the dictionary you get from the to_dict method directly or convert it to JSON.

    d = [page.to_dict() for page in form_pages]  
    json_string = json.dumps(d)  

    Reference if you need more from SDK -$web/python/azure-ai-formrecognizer/3.2.0b5/index.html

    Step 2
    Store the JSON file into a DB, here I am using export JSON file to SQL database as an example, please see below guidance.

    Then you can achieve your target - get Form Recognizer JSON data into a database. But from product point, our regular workflow is not as above, could you please share more about your scenario so that I can share it to product team to optimize this process?

    Our code sample for your reference -
    API sample
    SDK sample

    I will highly recommend you to try Form Recognizer Studio as you mentioned you are new, it's very easy to use and you can avoid those steps -

    I hope it helps! Feel free to let me know if you have any questions.


    -Please kindly accept the answer if you feel helpful to support the community, thanks a lot.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful