cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenTP
Regular Visitor

Form Recognizer Model Id not found

Hi all,

 

I am trying to use the Form Recognizer connector with no luck.

I trained a few models, with the Cognitive Services API using my Cognitive Services instance. It works fine, I am able to query all my models to analyze new documents using my Model Id, with the API.

 

Now I want to use these models in Flow using the Analyze Document connector, but I can't access my model Id's.

 

With the Get Models connector, no models in the list. And obviously when I try Get Model, the Model Id is not found....

Any idea of what's going on?

 

Thanks!

Ben

 

 

Flow_FormReco.PNG

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Hi,

I have the same problem and so far, I think its an issue with the Form Recognizer action / connector.

I'll show with the "Get Keys" example, although I have tried with other actions:


2020-05-19_20-32.png

 

I get the same error as you, but if I try to make the request directly through the API I get a valid response:

 

2020-05-19_20-46.png

I've made sure that the connector to Form Recognizer is correctly configured to the same host used in the HTTP request above


Something like this:

 

2020-05-19_20-57.png

 

Can you try making the request through the API to check if you (maybe) have the same issue as me or not?

In your case, your HTTP request (same as "Get Model") should be "https://{endpoint}/formrecognizer/v2.0-preview/custom/models/{modelId}"
(endpoint is https://{resource name}.cognitiveservices.azure.com)

View solution in original post

7 REPLIES 7
v-litu-msft
Community Support
Community Support

Hi @BenTP,

 

Sorry, I can't test the Get models action cause account limitation.

But I can give some advice:

1. You can check the Model location whether correct.

2. Try to use the Train Model action by input the model ID to check whether it work.Annotation 2020-05-12 162118.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi,

I have the same problem and so far, I think its an issue with the Form Recognizer action / connector.

I'll show with the "Get Keys" example, although I have tried with other actions:


2020-05-19_20-32.png

 

I get the same error as you, but if I try to make the request directly through the API I get a valid response:

 

2020-05-19_20-46.png

I've made sure that the connector to Form Recognizer is correctly configured to the same host used in the HTTP request above


Something like this:

 

2020-05-19_20-57.png

 

Can you try making the request through the API to check if you (maybe) have the same issue as me or not?

In your case, your HTTP request (same as "Get Model") should be "https://{endpoint}/formrecognizer/v2.0-preview/custom/models/{modelId}"
(endpoint is https://{resource name}.cognitiveservices.azure.com)

Hi @Anonymous ,

 

Thanks for your message, yes I was thinking using the http connector as well to make the API call rather than using the From Recognizer connector.

 

I'd tried what you suggested and it worked! I can query the model I built through the API.

I think I am going to go that way then.

 

And about this Form Recognizer connector, I am wondering if it doesn't work because I am on the free Tier for my cognitive services instance. Are you on free tier as well?

 

Cheers,

Ben

MikeD1
Regular Visitor

Were you ever able to input a file through your model and extract the tags through Flow?  I am running into the same issues with trying to run my model on a file through flow.   I was able to query the model through the HTTP call, but unsure exactly how to have it analyze a new file.

Anonymous
Not applicable

@BenTP 

Sorry for the late response. I am also on the free tier for Cognitive Services. I think the problem with the connector is that it's not updated to use the most recent version of the API. Check the answer here by Neta: https://stackoverflow.com/questions/61504780/adding-azure-logic-app-step-for-form-recognizer-2-0-has...

Anonymous
Not applicable

@MikeD1 
I actually got it to work. Might not be the best way but hey, if it works...
Just for reference, check this API documentation for the form recognizer. It was very helpful to me: https://westus2.dev.cognitive.microsoft.com/docs/services/form-recognizer-api-v2/operations/AnalyzeW...

In short, what I did was:

 First, call the API (in my case, the file was in an email attachement)

b_e_0-1597471658329.png

Then chek the "statusCode" of the response. I was looking for the "202" response, meaning that the request was accepted and it would be worked on. That same response will have the "Operation-Location" which is a call to "analyzeresults"

 

 

As said in the API docs, you can query the "Operation-Location" to track the progress, so that's what I did. I created a "Until" loop that kept sending another HTTP request (after a delay)

 

 

This loop was untill the response was either "succeded" or "failed"

2020-08-15 07_25_44-Outputs - Microsoft Azure.png

In this same responde I had the results

2020-08-15 07_28_24-Outputs - Microsoft Azure.png

After this I just parsed the results and I could work with them as I needed.

Hope this helps somehow

@Anonymous 

 

Thanks for the help, this is helpful.  I did read the documentation and I may be having an issue with syntax.  If I set the "body" of the HTTP post as you I get an error:

 

Invalid request body. analyzeJsonRequest is not valid.

 

Here is my post:

 

MikeD1_0-1597684252740.png

When I run this code I get this:

 

MikeD1_1-1597684317145.png

 

-Which appears that the attachment content is empty.  The "Get Attachment" operation does show content type.  This might be getting off topic and I may need to post this on it's own.  Thanks for the help though!

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (6,943)