Skip to main content
Community site session details

Community site session details

Session Id : 6W3cBRMRXmzs1YMdzye8WL
Power Automate - Building Flows
Answered

How to capture the same content type using the attachment name as well as the and/or condition for PDFs

Like (0) ShareShare
ReportReport
Posted on 5 May 2021 09:06:44 by

Hi all,

 

Totally new to Power Automate, a support ticket has prompted me to get to grips with it quickly. I've managed to use a pre-built template to setup a flow that will grab pdf attachments and save them to a SharePoint folder - The flow I have currently works, but only if the pdf file has been sent with the filename of pdf in lowercase, like so: MyDocument.pdf 

 

If the document is sent like this: MyDocument.PDF the flow says it completes but what I actually get is a false expression result and the document does not save.

 

What I am trying to do and failing miserably with is just add the 'Or' flag to the flow so that it will look for both but it doesn't seem to be working and I'm hoping some Power Automate wizard can help tell me where I'm going wrong.

 

The top image is the new one that I want to get working that currently fails - the bottom image is the same flow minus the 'Or' condition which works but only if the document has lowercase .pdf in the filename

 

Thanks in advance for any help

 

Nate

 

fails.JPGworks.JPG

  • Community Power Platform Member Profile Picture
    on 05 May 2021 at 14:07:30
    Re: How to capture the same content type using the attachment name as well as the and/or condition for PDFs

    Hi henkenTech,

     

    Thanks for the response and recommendation - I was just testing it all out before coming back to you. 

     

    Strangely the flow now works in that it will save the document no matter whether the filename is uppercase or lowercase but it does not convert to lowercase 

     

    Either way certainly resolved the issue for me, many thanks for such quick response!

  • Verified answer
    henkenTech Profile Picture
    135 on 05 May 2021 at 09:22:51
    Re: How to capture the same content type using the attachment name as well as the and/or condition for PDFs

    Hey there - no problem.

     

    You can use functions in any dynamic field. In your case you would use it here:

     

    Screenshot 2021-05-05 111630.png

     

    To insert a function, click on the "Expression" tab in the dynamic data picker:

     

    Untitled.png

     

    Then paste exactly:

     

     

    toLower(item()['name'])

     

     

    and click OK. item() takes the current attachment from the For Each and ['name'] tells the function to use the attachment name.

     

    See if that works for you 👍 

  • Community Power Platform Member Profile Picture
    on 05 May 2021 at 09:15:45
    Re: How to capture the same content type using the attachment name as well as the and/or condition for PDFs

    Hi henkenTech!

     

    Thanks for the quick reply - I suspect so but you'll have to forgive me as I don't know what that function is or where to apply it. 

     

    I presume it just saves the document in all lowercase rather than as it appears when it hits the flow? If so then I think it would only work adding it in before the condition? 

     

    Would appreciate any guidance on how to achieve it if so as I'm fairly confident that would resolve it for us, we aren't precious about keeping the filenames uppercase.

     

    Thanks

  • henkenTech Profile Picture
    135 on 05 May 2021 at 09:11:42
    Re: How to capture the same content type using the attachment name as well as the and/or condition for PDFs

    Hey there,

     

    in these cases, I tent to use the toLower function on the file name to make everything lowercase and then you just need one condition. 

     

    toLower(triggerOutputs()?['body/{FilenameWithExtension}']))

    contains ".pdf"

     

    Would that work for you?

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete