cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
callum_williams
Level: Powered On

Save email attachment in sharepoint, OCR the attachment if its an image, update a column on the file

Hi there,

 

I was hoping someone might be able to point me in the right direction for a task i'm trying to create in Flow.

 

We would like to scan images to an email address

When an email is received, Flow should save the attached image in Sharepoint

Flow should then OCR the image and find a specific string of text and numbers after it i.e. "Invoice: 99999999"

Flow should then alter the file saved earlier to add the returned string to a specific column i.e. "Invoice No".

 

I can get Flow to create the file from one of the templates that i've modified slightly, however the pieces i'm missing are 1) letting the OCR (Computer Vision) know the location of the image to scan, 2) searching for the specific string of text and storing it in a variable, 3) getting the file from earlier, 4) updating the file from earlier with the text returned from the OCR step.

 

If anyone could point me in the right direction for the steps i believe i am missing, or perhaps a better flow entirely to complete the task that would be fantastic!

 

If there are any more details that would be useful to know please shout up and i'll gladly provide what i can.

 

Many thanks in advance!

2 REPLIES 2
Community Support Team
Community Support Team

Re: Save email attachment in sharepoint, OCR the attachment if its an image, update a column on the

Hi @callum_williams

 

Could you please expalin more about the OCR that you mentioned.?

Could you please share a screenshot of your flow and share more details about your trouble when achieve your requirement so we would try to provide a proper workaround for you.

 

Best regards,

Alice

callum_williams
Level: Powered On

Re: Save email attachment in sharepoint, OCR the attachment if its an image, update a column on the

Hi Alice,

 

Here is a link to the Azure Computer Vision app: https://azure.microsoft.com/en-gb/services/cognitive-services/computer-vision/, you create it as a resource in Azure and then use the keys to link Flow to it.

 

I've got a screenshot of the entire flow but its quite large so here's a link: https://ibb.co/Jd7SqCC

 

The error happens at the "Optical Character Recognition (OCR) to Text" step,

 

Here is the full image code:

 

{
  "@odata.type": "#Microsoft.OutlookServices.FileAttachment",
  "Id": "AAMkADExYzZhYzRmLWIwN2YtNDBmMi04NDk5LWQ5NTMwOWQ1MzExYwBGAAAAAAAkPObnF1jISL7uUQBXDG2WBwA0JXmDeNHnSLA-22eXJQEVAAAAAAEMAAA0JXmDeNHnSLA-22eXJQEVAAGlth_bAAABEgAQAHHfU0L9pIFItfZF82-qNYQ=",
  "Name": "B001FTFR.TIF",
  "ContentType": "image/tiff",
  "Size": 143247,
  "ContentBytes": "SUkqAHwUAgD/2P/AAAsIYTuoHwDFU4W/Nrrt55/2GKEAHQAA"
}

Here is the body from the error:

 

{
  "code": "BadArgument",
  "requestId": "6e6cf510-e3d4-4aa8-af03-8910428a4887",
  "message": "JSON format error."
}

Many thanks

Callum

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 317 members 5,661 guests
Please welcome our newest community members: