Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Download Attachment to one drive and Rename CSV file

(1) ShareShare
ReportReport
Posted on by 2

Hi, Can Someone help my out how do I download a file to OneDrive and rename it to "CPLF" which will replace existing file.

 

teja_f3_0-1690113525870.png

teja_f3_1-1690113535038.png

 

 

  • abm abm Profile Picture
    32,464 Most Valuable Professional on at
    Re: Download Attachment to one drive and Rename CSV file

    Hi @teja_f3 

     

    You flow mappings looks ok to me except couple of things

     

    1. You can directly declare the value under the create file action and it will overwrite the existing file. You don't have to use initialise variable but nothing wrong in that too.

     

    2. Its about your IF condition. Remember the comparisons are case sensitive. So if you looking to get only .CSV files then better to convert to one case either small or capital using the expression ToUpper() or ToLower(). Also in my condition I used the operator as ends with. Here is my condition.

     

    image.png

     

    If you flow is not working then I believe your attachment is something like test.csv and you are checking CSV (capital) which won't evaluate it correctly. I am not sure about you have three conditions and one is left to blank as well.

     

    Above the expression I used is

     

    toLower(outputs('Get_Attachment_(V2)')?['body/name'])
     
    Thanks

     

     

  • trice602 Profile Picture
    13,760 Super User 2025 Season 1 on at
    Re: Download Attachment to one drive and Rename CSV file

    trice602_1-1690139343436.png

     

  • trice602 Profile Picture
    13,760 Super User 2025 Season 1 on at
    Re: Download Attachment to one drive and Rename CSV file

    One note here, in case you don't know:  when you add the action 'Get attachments' and select the "MessageID" from the trigger, your 'Get attachments' will automatically get wrapped inside the apply_to_each.  Always glad to help! Tom 👍🏽👍🏽👍🏽👍🏽👍🏽

  • trice602 Profile Picture
    13,760 Super User 2025 Season 1 on at
    Re: Download Attachment to one drive and Rename CSV file

    Hi @teja_f3 ,

     

    Here's a flow to review.  Please mark as a solution and give me a thumbs up (I'm collecting badges and kudos).  Always glad to help! Tom

     

    trice602_0-1690139146338.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

🌸 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,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow