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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Passing email attachme...
Power Automate
Unanswered

Passing email attachment PDF to custom trained AI model inside Do Unitl loop

(0) ShareShare
ReportReport
Posted on by 36

Getting email PDF attachment from email in ApplyToEach loop to pass to AI Model Extract info from docs, work smoothly using Dynamic Content values using expression.

 

items('Apply_to_each')?['contentBytes']

 

I'm trying to pass file content to AI model inside Do Until loop and I tried all possibilities of expression to get file content but it doesn't work though I can able to get attachment file name, size etc.

 

Following expressions I tried and it didn't work.

 

items('ProcessEmails')?['attachments'][variables('counter')]?['contentBytes']

 

 

Following expression works for ContentType

 

items('ProcessEmails')?['attachments'][variables('counter')]?['contentType']

 

 

Categories:
I have the same question (0)
  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Hello @microsoftee,

     

    this is a very special bug. I've created a ticket a view months ago but Microsoft doesn't understand the question or requirement. The ticket is still open.

     

    Possible workaround could be:

     

    base64(base64ToBinary(items('Apply_to_each')?['contentBytes']))
    or
    string(items('Apply_to_each')?['contentBytes'])
     
    But you have to be careful. Using this expressions leads to another bug (also created a ticket but won't be fixed). You won't see that formula if you don't use it inside a compose action. It will work but the only way to see the formula is by using "peek code".
  • microsoftee Profile Picture
    36 on at

    Hi @Matthy79 ,

    Strangely the following expression worked for me. I missed "Include Attachments" setting for "Get emails" action. Don't know how other properties of attachment file working even with Include Attachments = No

    items('ProcessEmails')?['attachments'][variables('counter')]?['contentBytes']

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard