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 / 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

Forum hierarchy changes are complete!

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

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 258 Super User 2025 Season 2

#2
trice602 Profile Picture

trice602 205 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 204 Most Valuable Professional

Last 30 days Overall leaderboard