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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Attach File from Share...
Power Automate
Answered

Attach File from Sharepoint and send email every week Tuesday at 11 am and the file name should be CSAT Update 09.04.2023 plus 7 days.

(1) ShareShare
ReportReport
Posted on by 139

Hello All, 

 

I am looking to make a flow where a file is picked up from Sharepoint every week at 11 am on Tuesday and looks for the name CSAT Update 09.04.2023 plus 7 days every week and send an email to users. I would really appreciate your help here. Thanks. 

Categories:
  • Ahmedz Profile Picture
    139 on at
  • Ahmedz Profile Picture
    139 on at

    @Agnius,

    @ManishSolanki

    @Nived_Nambiar

    @SamLed

    @Expiscornovus

    @creativeopinion

    @SudeepGhatakNZ

    @lbendlin

    @tom_riha

  • trice602 Profile Picture
    16,699 Super User 2026 Season 2 on at

    Hi @Ahmedz ,

     

    Here's the flow, modify as needed to meet your needs.

     

    The email results:

     

    trice602_0-1694203206358.png

     

    The flow:

     

    trice602_1-1694203237590.png

     

    Flow details:

     

    trice602_2-1694203276910.png

     

    Ok, so here I am subtracting one day from Tuesday, since the date you provided me was 09.04.2023 which is a Monday but you want to run this on Tuesday morning so on Tuesday this week, we need to dynamically get the day before every day this runs, again modify as needed.

     

    addDays(formatDateTime(utcNow(),'MM-dd-yyyy'),-1)
     
    trice602_4-1694203425821.png

     


     

     

    Next, we need the format the way the file is named 09.04.2023 so we have to take the date and format it:
     
    formatDateTime(parseDateTime(split(outputs('Compose'), '.')[0]), 'MM.dd.yyyy', 'en-US')
     
    trice602_5-1694203506029.png

     

    Next, we need to get the file content for our attachment:

     

    trice602_6-1694203566451.png

     

    Be sure to include the space between Update and the dynamic content from Compose 2 output (above)...

     

    How to add the attachment:

     

    trice602_7-1694203658186.png

     

    This is scheduled to run every Tuesday and will look for the file with the dynamic file name in your SharePoint library. If the file doesn't exist, the flow will fail.  Keep in mind, in your recurrence you may need to adjust accordingly for your time zone.  What I typically do is know my UTC time related to my time zone and just code appropriately.  So in Phoenix, Arizona, I know UTC is 7 hours ahead so if I wanted this to go out at 11 AM local time, I would set the time for 4 AM (with no time zone adjustment).

     

     

     

     

     

  • trice602 Profile Picture
    16,699 Super User 2026 Season 2 on at

    Note:  I used today's date for testing purposes, looking back to get yesterday's date but I would get 09.04.2023 if ran on 09.05.2023. 🙂

     

     

  • Ahmedz Profile Picture
    139 on at

    Thank you so much for your detailed response. I appreciate it :). I am having a few issues as when I run the flow it returns saying no file was found. I will change the date in the library and that might work , will let you know and also I am in Georgia so how should I adjust the code in terms of UTC if we need delivery of email every Tuesday at 11 am. And just FYI , I think you did include that factor when you made the flow but the name of the file would change every week adding 7 days to the last file for example, CSAT Update 09.05.2023 to CSAT Update 09.12.2023. Thanks 🙂

  • Ahmedz Profile Picture
    139 on at

    So I am getting this error. And when I remove the outputs dynamic from get file section the flow runs but I don't receive an attachment in the email. So there is some error at my end which needs to be rectified.

    2023-09-11_09-47-32.png
    2023-09-11_09-47-32223323.png
    2023-09-11_09-47-322233.png
  • trice602 Profile Picture
    16,699 Super User 2026 Season 2 on at

    Hi @Ahmedz ,

     

    The error is because in your SharePoint action, you have hardcoded the date 09-04-2023.  Please review my original reply and this screen below.  Also, my example refers to an .xlsx file, remember to change yours to .pptx in my the SharePoint and Email action.

     

    Also, remember to include a space between Update and (dynamic outputs) in the file name to match the file name format.  Please mark as a solution!  Always glad to help! Tom

     

    trice602_0-1694445087257.png

     

     

     

  • Ahmedz Profile Picture
    139 on at

    So I have tried doing what you did as well. I haven't hard coded this time and it is still giving me that same error. I have shared some snaps. I am not sure what step I am missing out on. When you select the folder from share-point do you select the actual file or the last folder. ?

    2023-09-11_09-47-3222332332.png
    2023-09-11_09-47-3222332332456.png
  • trice602 Profile Picture
    16,699 Super User 2026 Season 2 on at

    Hi @Ahmedz ,

     

    What's the name of the file you are attempting to grab here?  In my example it is today's date less one, do you have a file named CSAT Update 09.10.2023.pptx in the appropriate folder?

     

     

  • Ahmedz Profile Picture
    139 on at

    Yes. That was the name of the file I used. I have changed it to another folder and new file path as well and having same issue. 

    2023-09-11_09-47-378456.png

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 299

#2
11manish Profile Picture

11manish 274 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard