Hi 🙂
I am trying to rename a file in a document library on SharePoint Online, I want that when a user upload a file, a flow change it name, adding the current date and hour. I am not know the formula to add the date at the name of the file, can help me please whit information about that. Is important too that when the user upload a new document the flow don't generate a new version on the historical version document.
Im am trying whit sharepoint designer because I don't know how to create a flow in Microsoft Flows, thanks fot your helps.
🙂 😃
Solved! Go to Solution.
Hi @jkeckard007
This is your screenshot below. I highlighted what seems to be wrong in your Update File Name step. Please correct those and try again. Let us know if it worked.
Regards,
Fausto Capellan, Jr
Sam error. I do know the list name has been changed so I am not sure if that matters the actual url SPECIFICATION%20UPDATES/Forms/Active.aspx
Below is the output I am trying to rename the file name...not the folder name...is that an issue?
Hi @jkeckard007
First, try to navigate to the URL in your screenshot, which should look like: http://yourdomain.sharepoint.com/sites/yoursitehere/_api/web/lists/getbytitle('Spec Bulletins Pending Library')/items(400). This is to make sure items are being retrieved. If that works, then update the Body of your Update File Name step as indicated in the screenshot below:
{'__medatada':{'type':'SpecBulletinsPendingLibrary'}, 'FileLeafRef':'SB-038-Title MSFlow'}
Sorry for the back and forth. I do get the rest call back I checked that but still having issues
Hi all,
I finally figured this out but took me a little more investigating. The issue for me was in regards to the Body and the Sp.Data line. It kept on giving me an error "A type named 'SP.Data.BItem' could not be resolved by the model. " This was because BItem was not the name of my document library, however even using the document library name 'SP.Data.Published%20BackupsItem' this still failed. Until I discovered the way to find the actual SP.Data name.
I plugged this into my browser:
https://yourdomain.sharepoint.com/sites/yoursitehere_api/web/lists/GetByTitle('Published%20Backups')?$select=ListItemEntityTypeFullName
Looking near the end of the resulting output located for me the correct SP.Data value I had to add:
<d:ListItemEntityTypeFullName>SP.Data.Published_x0020_BackupsItem</d:ListItemEntityTypeFullName>
In case it wasn't clear it was SP.Data.Published_x0020_BackupsItem for me
So I amended the body as below and it worked a treat:
{'__metadata':{'type':'SP.Data.Published_x0020_BackupsItem'},'FileLeafRef':' @{outputs('Compose')}'}
Regards,
Mohamed Imran
I find this thread today, learn from you guys and find a workaround to my problem of adding prefix to all file names in a folder. Thank you very much, especailly @faustocapellanj .
@jkeckard007 , one remaining mistake I catch: instead of the boy's name, try "application/json; odata=verbose". Hope it helps.
For my problem, my original approach is to get hold of the folder, list out the files within the folder, and the update the file names one by one:
However, I can't get hold of Item ID of the respective files but just the File ID (as shown as Id) this way.
Flow excerpt to add prefix to files in folder
Excuse me for digressing but any insight on the relationship between File ID and Item ID?
Hi All,
Thanks for all your advices.
Unfortunately I still have some error when I run the flow:
My list is: temp_ml
Error: BadRequest
Body:
{'_metadata':
{'type':'SP.Data.temp_mlItem'},'FileLeafRef':'Nombre'
}
What could be the issue?
Thanks!
Can you please post a screenshot of your Flow action, especially the HTTP action?
Thanks,
Fausto Capellan, Jr
Hi @faustocapellanj ,
Thanks for great guidance on this post. I have a question, how can I navigate to an item with other properties, and not ID. I mean in _api/web/lists/GetByTitle('ListName')/items(ID), is there a way that I put for example file name instead if ID. Please advise.
Thanks
Hi @Sorenaa
What are you trying to achieve exactly so I can point you on the right direction?
That was quick! Thanks. I am trying to do the rename a file, which I copied within a folder in previous step in my flow, so I don't have the item ID, I want to know if I can navigate to item by something else, e.g. item's Name. Am I clear enough?
Thanks,
Can you please post a screenshot of your Flow?
Thanks.
I am not sure what to put in .../items (??) to access the file by name. My goal is after copy folder is done, rename a file that exist in the folder just copied over.
Thanks
Hi @Sorenaa
Not sure if the Copy SharePoint Folder from Library will give you the file ID since it's just copying a folder. How many files do you have in the folder being copied?
Yes, that's why I am asking if I can anything else other than ID. There are couple of files and folders.
Thanks,
Hello, I have a question, I
have the flow like this.
What I need to do is to be able to add a new file to the SharePoint list and if I am using the same name from other files, the flow changes the name of the file or just add something to have both, can you help me with it?
Hi @Anonymous
Mi first idea is:
1. Create a String Variable with a known content (for example _empty). I will call VarName
2. Get files (properties only) with filter Name eq 'VarName'.
3. Set Variable with the propertie Filename (from Get Files). (Dont worry about Each One iteration, because you only will have one element).
4. IF Control with the condition: IF VarName not equal to '_empty'.
If yes, rename the file. If no, do nothing.
If the Flow will execute again in the same Run, then dont forget to set again VarName to _empty after rename the file.
@jonatanmunoz I am very new with all this, do you have a way to contact you? more than here, like skype or email or something?
Hi @v-bacao-msft,
I tried this but Im getting the error:
List 'Rechnungseingang' does not exist at site with URL.
I don't know what I'm doing wrong, because I just started with Workflow. What I want to do is, when a user fills values into certain columns, that the filename is automatically renamed with these values.
Best Regards,
Emi
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
72 | |
26 | |
16 | |
16 | |
15 |
User | Count |
---|---|
145 | |
45 | |
44 | |
33 | |
30 |