Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Power Automate Flow being iffy and irregular

(0) ShareShare
ReportReport
Posted on by 19

I have created the following flow: 

Save my email attachments to a SharePoint document library. 

 

The flow has no errors or warnings. This is the problem :-

Whenever I get an email, the flow does not save the attachment into SharePoint. Now, if I go to the flow, edit and just re-save it without any changes, on re-saving it runs and saves that attachment into SharePoint. 

 

When I send a second email, again, the flow doesn't run. I have waited for ~30 minutes and still it does not. However, as soon as I resave the flow, it runs at that instant. 

 

My flow is correct but why am I experiencing this issue? I am confused regarding the problem causing this. 

I created a similar flow where the email attachment saves into my OneDrive, in this case, the flow runs smoothly all the time, without any troubles. 

Any help will be appreciated. 

Thank you! 

  • Pulakit21 Profile Picture
    19 on at
    Re: Power Automate Flow being iffy and irregular

    Hey Man, I ran into a BIG problem. 

     

    The flow successfully works. However, here is the issue -> 

    If I email myself, the csv file gets renamed, timestamp gets added and it saves successfully without messing the file. 

    If my colleague sends me an email with the same file, renaming and timestamp works but as soon as I open the save file, the entire file gets messed up. All data is lost and there's a bunch of gibberish. 

     

    Why is this happening? How do I fix it? 

  • Pulakit21 Profile Picture
    19 on at
    Re: Power Automate Flow being iffy and irregular

    Hi Ellis, 

    Thanks for the help. I ended up figuring out another way to do it. 

     

    I used the current time built-in function, pulled out its output, saved it in a custom format "yyyyMMdd-HHss". Once this was done, I added this output with new file name as "yyyyMMdd-HHss-Input_File.csv". 

    It worked. 
    Appreciate all the help. Still new to this and its super fun. 

  • Ellis Karim Profile Picture
    10,893 Super User 2025 Season 1 on at
    Re: Power Automate Flow being iffy and irregular

    Can you post a screenshot of the error?

    When entering the expression in the Expressions editor, you will need to enter it similar to this:

    ekarim2020_0-1629209812262.png

     

    formatDateTime(body('Current_time'), 'yyyy-MM-dd-HHMMss')

     

    The above is the preferred method if possible.

    Or directly in to a string value, only if the variable names in the demo match your variable names, e.g:

    ekarim2020_1-1629209937161.png

    The expression below can be copied and pasted into a variable.

    @{formatDateTime(body('Current_time'), 'yyyy-MM-dd-HHMMss')}

     Ellis

  • Pulakit21 Profile Picture
    19 on at
    Re: Power Automate Flow being iffy and irregular

    Hey man, 

     

    I am trying to do so but the expression you provided, it keeps getting flagged as invalid on my end. 

    Do you know why? 

  • Ellis Karim Profile Picture
    10,893 Super User 2025 Season 1 on at
    Re: Power Automate Flow being iffy and irregular

    Here is one method you could use to achieve this. Get the current time, format the current time so it can used as a be pre-fix for the filename:

    ekarim2020_1-1628791364259.png

    The expression below can be copied and pasted into the variable TimeStamp:

    @{formatDateTime(body('Current_time'), 'yyyy-MM-dd-HHMMss')}

    The timestamp format uses year, month, day, hour, minutes and seconds:

    ekarim2020_2-1628791580150.png

    Hope this helps.

    Ellis

  • Pulakit21 Profile Picture
    19 on at
    Re: Power Automate Flow being iffy and irregular

    Hi Ellis, 

     

    Hmmm, makes sense. But let me give you some more context. 
    The purpose of this flow is to put a email attachments (these attachments will be of same format, being sent to one particular distribution list) in sharpoint so my python script can access this file. 
    My python script reads "Input_File.csv", hence I do renaming under automate flow. The issue is when a second attachment is sent, it overwrites. To not allow this, I was thinking of adding a timestamp to differentiate the files. 

    Thoughts? 

  • Ellis Karim Profile Picture
    10,893 Super User 2025 Season 1 on at
    Re: Power Automate Flow being iffy and irregular

    I would advise leaving the filename untouched (unless you want to give the file a more meaningful name) and use what SharePoint already knows about the file (the meta data). We can display a column showing when the file was created in the SharePoint list or library. Without any real "work" you can display the file's Created time (or Modified time, or Created by person, or Modified by person) on your view:

    ekarim2020_2-1628787723685.png

    ekarim2020_3-1628787792138.png

    You can also change the order the files (items) are displayed: newest first, oldest first, or sort alphabetically. This can be done by changing the current view or creating a new view to display your content.

    To learn more about SharePoint views please see:  Create, change, or delete a view of a list or library

    Ellis

     

     

     

  • Pulakit21 Profile Picture
    19 on at
    Re: Power Automate Flow being iffy and irregular

    I did what you asked for by making a copy.

    The flow somehow is running faster now. I did two trial runs and it took 3-4 minutes max to get the file to sharepoint. What is happening? I am confused on the backend workflow behind these automate flows. 

     

     

    I have a follow-up question which is bothering me. I want to add timestamp to my file name so it is easier to see on sharepoint which file was received when. 
    This is how I am renaming the coming attachments to "Input_File.csv". I want to rename it to "Input_File_(timestamp).csv"
    Any insight would be great. 

     

     

    1.JPG

  • Ellis Karim Profile Picture
    10,893 Super User 2025 Season 1 on at
    Re: Power Automate Flow being iffy and irregular

    Can you share the flow and the run history (see below):

    ekarim2020_0-1628761965115.png

    in step 3 click on the one of the run time dates:

    ekarim2020_2-1628762054091.png

    This will show the execution of the flow. We may be able to look inside some of the actions to see what is going on.

    ekarim2020_4-1628762352416.png

    Click on the actions that have executed view input to and outputs of the actions:

    ekarim2020_3-1628762103081.png

    Ellis

  • Pulakit21 Profile Picture
    19 on at
    Re: Power Automate Flow being iffy and irregular

    Thank you, I will go ahead and give this a shot. 

    In the meanwhile, I did some digging and testing. My current flow works perfectly but it is taking ~1 hour for every run. It takes ~1 hour for files to get saved into my Sharepoint library but continues to be instant for OneDrive. 

    Could this delay be because I use VPN to connect to my company's server? I work remote right now. Or it is something which can't be fixed? 

     

    Thanks!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,601 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,942 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow