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 / UPLOAD files from Powe...
Power Automate
Answered

UPLOAD files from Power Apps to SharePoint Document Library via Power automate

(0) ShareShare
ReportReport
Posted on by 181
Hi everyone,
 
i want to use the power automate to upload files from Power Apps to SharePoint Document Library.
 
It is work to upload file but there will replace if upload the same file.
 
May i know how to update the flow that it can upload the same file that save as new one or how to change the file name more different?
 
 
Below is my power app code:
Set(vCLPInspectionPhotosPath,"https://clpgroup.sharepoint.com/sites/CLPEMSform/CLPE%20Inspection%20Photos/"& BrowseGallery.Selected.Title &"/");
Clear(vPhotoPathCollection);
ForAll(
    Attachment_Inspection_Record.Attachments,
   IfError(Uploadfiletosharepoint_CLPE.Run(
        BrowseGallery.Selected.Title,
        {file:{name: BrowseGallery.Selected.Title & "_" & Text(Today(),"dd-mm-yyyy") & "_Inspector Record.jpeg", contentBytes: ThisRecord.Value}}),
        Notify("Photo Upload Failed"));
 
    Collect(vPhotoPathCollection, vCLPInspectionPhotosPath & BrowseGallery.Selected.Title & "_" & Text(Today(),"dd-mm-yyyy")&"_" &"_Inspector Record.jpeg");
);
Set(vPhotoPath1, Index(vPhotoPathCollection, 1));
 
Patch(
    'CLPE Inspection Record', Defaults('CLPE Inspection Record'), {
Photo1: vPhotoPath1.Value
}
    );
 
 
my flow:
 
Would anyone can help?
Thank you very much for your help.
Categories:
I have the same question (0)
  • Verified answer
    SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    You could just append the utcnow() after the file name followed by the file extension , so something like this.
     
    File extension: last(split(triggerBody()?['file']?['name'],'.'))
    File name: concat(join(skip(split(triggerBody()?['file']?['name'], '.'), 0), '.'), '.')
     
    Unique file name: concat(join(skip(split(triggerBody()?['file']?['name'], '.'), 0), '.'), '-', formatDateTime(utcNow(), 'yyyy-MM-ddTHH-mm-ss'), '.', last(split(triggerBody()?['file']?['name'], '.')))

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard