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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to rename an attac...
Power Automate
Answered

How to rename an attachment file using flow (the simplest way) with powerapps

(0) ShareShare
ReportReport
Posted on by 943

Hi all..

 

im new with flow and also with powerapps.

 

i need to know the simplest way how to do the renaming file that want to be uploaded using powerapps attachment control. i need to learn this.

 

please help me.

 

thanks,

regards.

pytbyt

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @PytByt 

     

    Can you please share more details on this? Where are you uploading the attachment (is it to SharePoint)?

  • PytByt Profile Picture
    943 on at

    @yashag2255 wrote:

    Hi @PytByt 

     

    Can you please share more details on this? Where are you uploading the attachment (is it to SharePoint)?


    hello @yashag2255 

     

    yes, im using SP List to store the attachment. The idea is to rename the file to match the ID field in the same SP List. 

     

    whilst i notice that the SP List cannot creat a new column for each attachment i submitted.

     

    can you help me please..

     

    thanks,

    pytbyt

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @PytByt 

     

    Okay. So for automatically renaming the attachment I would suggest you follow this flow in the screenshot below:

    Fg1.png

     

    Fg2.png

     

    Fg3.png

    This flow will rename the attachment as ItemID - Filename.extension. Carefully map the delete attachments action to the file id from the get attachments action or else you will delete the worng attachment. 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • PytByt Profile Picture
    943 on at

    @yashag2255 

     

    Okay mate, i will try it and will get back to you later.

    by the way, is it work with multiple file attachment with one ID? 

     

    i just learn that SP list in 1 record can hold up a multiple attachment file, so i want to make it like:
    ID:

    11

     

    Attachment name:

    11 - ID Card.jpg
    11 - Member Card.pdf

    11 - Approval. docx

    etc.

     

    is it possible to achieve?

     

    cheers.

    pytbyt

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    HI @PytByt 

     

    Yes. If you see the flow, I have used the apply to each action that will consider all the attachments associated to the list items. It will apply the logic to all the attachments on the list item. 

     

     

  • PytByt Profile Picture
    943 on at

    @yashag2255 wrote:

    Hi @PytByt 

     

    Okay. So for automatically renaming the attachment I would suggest you follow this flow in the screenshot below:

    Fg1.png

     

     

     

     

    This flow will rename the attachment as ItemID - Filename.extension. Carefully map the delete attachments action to the file id from the get attachments action or else you will delete the worng attachment. 

     


    Hi @yashag2255 

     

    Could you help me choosing which all the path should i take with the flow above?

    Because the picture above is not so clear, and also blurry.

     

    Maybe you canmake a short video, so everyone can see and learn?

     

    thanks,

    pytbyt

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @PytByt 

     

    You can click on the images and see a better resolution. Path wise here is the flow : 

    When an item is created or modified -> Initialise an array variable with empty value. -> Check if the item has any attachments -> if yes, Get the attachments by item ID -> Apply to each of the attachments and populate the array with the name split by the identifier for each attachment. If the identifier exists, then do nothing else Get the attachment content and create a new one with this conetent but the name will be appended along with the ID and then finally delete the previous attachment. 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • PytByt Profile Picture
    943 on at

    @yashag2255 

     

    i already did that (click on the image to enlarge it) i even open it on the new tab, but its still blurry and not clear enough for me to understand this part:

    if yes, Get the attachments by item ID -> Apply to each of the attachments and populate the array with the name split by the identifier for each 

     

    Please help me understand it more. I need the expression that you used.

     

    Much Appreciated.

     

    Regards,

    pytbyt

  • Community Power Platform Member Profile Picture
    on at

    Hi,

    Can you please show the function that is used in "Set Varibale" inside "Apply to each"? 

    It will be a big help.

     

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 305 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 155 Most Valuable Professional

Last 30 days Overall leaderboard