cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Donya
Frequent Visitor

copy and renaming excel file in the new files

I used a flow to make a folder and include an excel sheet when new info is added. Is there any way to rename the excel sheet and include the folder number in it?

Can someone please help me to make a new flow or modify the existing one.

In the existing one.

Thanks 

Donya_0-1644429562648.png

 

Donya_1-1644429581508.png

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

It should be the other way around

image.png

And in the URI you should have .../GetByTitle('LineUps')/items(....

And in the FieldValue remove the < and >



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

8 REPLIES 8
tom_riha
Super User
Super User

Hello @Donya ,

you can rename a file, but you'll need the 'Send an HTTP request to SharePoint' action to do that. The request should look as below:

Method: POST

Uri: _api/web/lists/GetByTitle('<LibraryName>')/items(<DocumentID>)/validateUpdateListItem

Body:
{
    "formValues":[
	{
	    "FieldName": "FileLeafRef",
	    "FieldValue": "<NewFileNameWithExtension>"
	}
    ]
}

Note: all the <...> parts must be replaced



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
Donya
Frequent Visitor

Thanks @tom_riha 

, I tried to add it to the existing flow. here is the error : 

Could you help me with this thanks 

Donya_1-1644442408432.png

 

Donya_2-1644442487314.png

 

Hello @Donya ,

it should be the ItemId provided by the 'Copy file' action, not the numeric ID you assigned to the item.

And the list name should be just the list name, inside single quotes.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
Donya
Frequent Visitor

@tom_riha Sorry I still don't know what to put between <> here is the copy file I want to replace "Template" with "Project" number

Donya_2-1644443412576.pngDonya_3-1644443431096.png

Donya_4-1644443456061.png

 

Donya
Frequent Visitor

@tom_riha Sorry I still don't know what to put between <> here is the copy file I want to replace "Template" with "Project" number

Donya_2-1644443412576.pngDonya_3-1644443431096.png

Donya_4-1644443456061.png

 

Donya
Frequent Visitor

@tom_riha Sorry I still don't know what to put between <> here is the copy file I want to replace "Template" with "Project" number

Donya_2-1644443412576.png

Donya_4-1644443456061.png

 

It should be the other way around

image.png

And in the URI you should have .../GetByTitle('LineUps')/items(....

And in the FieldValue remove the < and >



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
Donya
Frequent Visitor

Thank you @tom_riha  🙂 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,540)