cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

6 REPLIES 6
Community Support
Community Support

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

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

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


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


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

 

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


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

You're a super star.

 

That works fantastically and I've learnt a lot.

 

Thank you for your time.

 

Graham

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (3,618)