cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Frequent Visitor

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
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.

Frequent Visitor

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

Regular Visitor

Hi @b_e ,

 

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

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.

Frequent Visitor

@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...

Frequent Visitor

@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

@b_e 

 

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (7,076)