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 / Check that an email co...
Power Automate
Unanswered

Check that an email contains at least one PDF file, otherwise send email back to sender

(0) ShareShare
ReportReport
Posted on by 38

Hi,

 

I am trying to build an app to: Check that an email contains at least one PDF file

but I do not know how to check for at least one pdf attachment.

 

check attachments has a pdf file.png

 

 

 

 

 

 

 

 

 

Any experts help would be greatful.

 

Thank you in advance.

Graham

 

P.S. Is there a designer flow help file/resource anywhere online?

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    on at

    Hi graham-oriley,

     

    According to your scenario “check an email contains at least one PDF file”, then you could consider to add a Condition to check if an email contains a PDF file.


    If yes, do an action you want. If no, use the action “Office 365 Outlook – Reply to email”.


    When an email arrives without a PDF file, an email will be sent back to the sender.

    4.PNG

     

    Please try if this will work for you.

     

    Best regards,
    Mabel Mao

  • graham-oriley Profile Picture
    38 on at

    Hi,

     

    Thanks for the information and help.

     

    I have applied your logic to my flow but I receive a rejection email when one of the attachments is not a .pdf.

    An email should only be sent if one of the attachments was not a pdf.

      

    The only difference I can see between what I have done and yours is that I have a For Each and you have an

    Apply to Each - I do not know how to change mine? Is this possibly the issue?

     

    check attachments has a pdf file part 2.png

     

     

    Regards,

    Graham

  • gamoraes Profile Picture
    1,040 on at

    HI @graham-oriley

     

    What you need is a variable, you set this if has an pdf and after for each you verify if the variable is true, look the print below.flow 1.png

     

     

     

    Hope have helped,

     

    Gustavo Moraes

  • graham-oriley Profile Picture
    38 on at

    Hi,

     

    Thank you for the information, I didn't realise that logic apps had variables.

     

    I still have slight problem in that HasPdf appears to be false in the final condition, yet in the output I can see it was set to true.

    It's like the variable is set as inline and not global and so defaulting to the initialise value? Although if it was inline then I suppose the variable would be undefined?

     

    I've attached a word document with designer and output.

     

    If you could have one final expert view of what I doing wrong that would be fantastic.

     

    Designer

    pdf checker designer.png

    Output

    pdf checker output.png

     

    Regards,

    Graham

     

  • Verified answer
    gamoraes Profile Picture
    1,040 on at

    Hi @graham-oriley.

     

    I love help the community 🙂

     

    What you need is a simple conversion in your condiction, because the Flow compare the boolean value of variable with the string, with this the result is false.

     

    Click in "edit in advanced mode" on condiction and convert the string true to boolean, like above:

     

    @equals(variables('HasPdf'), bool('true'))

     

    after this run the flow and it's work.

     

    OBS: If you can kudo the reply it help me in the community 🙂

     

    Best Regards,


    Gustavo Moraes

  • graham-oriley Profile Picture
    38 on at

    You're a super star.

     

    That works fantastically and I've learnt a lot.

     

    Thank you for your time.

     

    Graham

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard