Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

File Survey in SharePoint Library for new files and send mail to recipient list with these files

(0) ShareShare
ReportReport
Posted on by 20

Hi all, 

I'm new to PowerAutomate and it seems the process I'm looking for is not the easiest to start with (at least for me as a newbie). So here we go: 

I have a SharePoint Library and I'd like to survey one subfolder every day (at 8 in the morning) for new files. The relevant new files contain a certain string pattern ('1079' or '1081'), all other new files without that pattern should not be considered.

Next, I want to sent these files to a mail distribution list and mention the name of that new files in the main text body of the mail.

If there are no new file, no email should be sent.

Sounds simple... hope for you it is, wasn't for me 😄 

 

Any help is highly appreciated.

  • BenMielichSuess Profile Picture
    20 on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Ok, I found the issue. I created a "mock" file for testing, which was a *.txt file with a filename that will be matched with the requests of the flow, but the file did not contain any content! 

    Simply putting content into this text file made the flow run as expected!

     

    Thank you @v-jefferni so much for sharing your knowledge, it really made a difference here and I appreciate it a lot! 

  • v-jefferni Profile Picture
    on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Hi @BenMielichSuess ,

     

    It seems the Send an Email action was saved once using single attachment method. Please add another send an Email action, switch attachments to array mode, copy and paste other parameters from the old action and then delete the old action, save and test the flow.

     

    Best regards,

  • BenMielichSuess Profile Picture
    20 on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Thanks for pointing it out. I also noticed it and it was already changed before I got the error message from the "send an email" block, so unfortunately this is not the issue...

     

  • v-jefferni Profile Picture
    on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Hi @BenMielichSuess ,

     

    I found that you have the wrong condition in Condition control. It should be "is not equal to".

     

    BR,

     

  • BenMielichSuess Profile Picture
    20 on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Cool, thanks @v-jefferni, for all your efforts!

    That step seems to be fixed , but now the "Send an email" block gives me following error: 

     

    BenMielichSuess_0-1690790512666.png

     

     

  • v-jefferni Profile Picture
    on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Hi @BenMielichSuess ,

     

    It's incorrect in Select.

    vjefferni_0-1690789927611.png

     

    Best regards,

  • BenMielichSuess Profile Picture
    20 on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Hi, 

     

    i think it did not propagate the infos into the array: 

    Here's a screenshot from the history after the if yes/if no: 

    BenMielichSuess_0-1690789003744.png

     

    However, i received an email yesterday with no content (no file attachements; only title, no body), and the file was pasted 3 days ago to the sharepoint and the recurrence of checking is set to 1 day...

     

    Here's again my flow, hope there's no error somewhere?

     

    BenMielichSuess_1-1690789275975.png

    BenMielichSuess_2-1690789309455.png

     

    BenMielichSuess_3-1690789339411.pngBenMielichSuess_4-1690789402772.png

    BenMielichSuess_5-1690789473849.png

     

     

  • v-jefferni Profile Picture
    on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Hi @BenMielichSuess ,

     

    You need to go to flow run history, see if there are files be found in Get files (properties only) action. 

     

    Best regards,

  • BenMielichSuess Profile Picture
    20 on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Hi, 

     

    thanks for the bugfix. Indeed the flow runs now without errors. However, I do not receive any emails if I create a test-file (e.g. "1079_test.txt") to the respective folder in the sharepoint library? 

    Do you know what the issue could be? 

     

    Thanks a lot!

  • v-jefferni Profile Picture
    on at
    Re: File Survey in SharePoint Library for new files and send mail to recipient list with these files

    Hi @BenMielichSuess ,

     

    Sorry, the column name is case sensitive, so please try:

    (substringof('1079',FileLeafRef) or substringof('1081',FileLeafRef)) and Created gt '@{addDays(utcNow(),-1)}'

     

    Speaking of recipients' Emails, using a list or Excel table is fine, you can get items from list or list rows from Excel table, then use a join function to concatenate all the Emails together with semicolon and set in To paremeter.

     

    Best regards,

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1