web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / AI builder flow runs ...
Power Apps
Suggested Answer

AI builder flow runs from the web version of power apps , but fails when ran from the "App"

(3) ShareShare
ReportReport
Posted on by 4
I have a flow that when launched:
 
Takes a photo taken with the camera, passes the value to a flow. Runs the AI Builder "Recognize text in an image or a PDF document".  This then returns the text of the picture.
 
The flow runs correctly and returns the text when launched from the web version.  
 
When launched from the Windows , IOS or android application, the flow fails with a bad gateway. 
 
 

	Camera onSelect
	
ClearCollect(ocrTestCollection,{ Picture : Camera.Photo , Index : 0});

 
Image
	LookUp(ocrTestCollection,Index = 0,Picture)

Button 

Set(uploadRC,Image3.Image);
Set(ocrResults33,AI_BuilderFlow_readsPDF.Run({name : "ocrImage.jpg", contentBytes: Image.Image}  ))
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Assisted by AI
    sannavajjala87 Profile Picture
    304 Super User 2026 Season 1 on at
    Hi,
    The "works on web, 502 on the native apps" combo with a camera image almost always comes down to image size. The Windows, iOS, and Android camera captures a much higher-resolution photo than the web player does, so the base64 payload you send to the flow is far bigger, and that oversized request (or AI Builder's own image size limit) comes back as the Bad Gateway. On web the photo is small enough to squeak through, which is why it only breaks on the apps.
    Two things to try:
    1. Shrink the image before sending. Lower the camera resolution or compress the photo so the payload is smaller. That alone fixes most cases.
    2. Send clean base64. Instead of passing Image3.Image straight in, use JSON(Image3.Image, JSONFormat.IncludeBinaryData), then strip the "data:...;base64," prefix and pass that into contentBytes. Web and native can resolve the raw image reference differently, and normalizing it this way avoids that.
    To confirm the cause, open the flow's run history and look at one of the failed runs launched from the app. The inner error there will tell you whether it's a size or OCR limit rather than the generic 502 the app surfaces.
    Hope that helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 392

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 271 Super User 2026 Season 1

Last 30 days Overall leaderboard