cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bschleter
Level: Power Up

Invalid Template- Text prediction

Having problems doing even the simplest of power flow. Followed the online manual and instructions to a T. First did it my way, then reverted back to do it exactly like how the manual online did. Still get the error in the Predict section, so I'm not even sure how it will function in parsing the JSON template provided online, or in the apply to each section. 

 

My first errors were no base64 encode. The manual did say to surround base64 encode with () vs string(), so I wrapped as such. 

 

Here is the code I am currently using in Predict, followed by screenshots. 

'

 

 

 

 

 

{ 
"@{base64Encoded(string(triggerBody()?['file']?['contentBytes']))}", 
"mimeType": "image/jpeg" 
}

 

 

 

 

 

as you can see, the base64 I made a dynamic function. As said before, I was getting the base64 encode error? as I was just using string() as the dynamic function. 

Screen Shot 2020-01-24 at 11.07.54 PM.pngScreen Shot 2020-01-24 at 11.08.06 PM.pngScreen Shot 2020-01-24 at 11.08.18 PM.pngScreen Shot 2020-01-24 at 11.08.25 PM.png

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Invalid Template- Text prediction

Hi @bschleter 

 

Can you check this post here: https://docs.microsoft.com/en-us/ai-builder/flow-text-recognition 

 

You can see that the "base64encoded" : string() is the correct format to pass as the parameters. Note that if you are passing the json payload, it needs to have a proper key and value that is not being passed in our flow. Also, you can get rid of the 'D' from the parse json. It is not the correct way to pass the argument. 

 

The error is at the predict action only and should be resolved if you follow the above. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

1 REPLY 1
Dual Super User
Dual Super User

Re: Invalid Template- Text prediction

Hi @bschleter 

 

Can you check this post here: https://docs.microsoft.com/en-us/ai-builder/flow-text-recognition 

 

You can see that the "base64encoded" : string() is the correct format to pass as the parameters. Note that if you are passing the json payload, it needs to have a proper key and value that is not being passed in our flow. Also, you can get rid of the 'D' from the parse json. It is not the correct way to pass the argument. 

 

The error is at the predict action only and should be resolved if you follow the above. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,204)