Hi Folks!
I have a flow that will create a file but the user can upload the same file. I'm having issues since the previous file have already the same filename.
Is there a way to create a filename(1).xlsx if the file name already existing?
I want to put that error handler if the create item triggers an error.
Can you expand the actions for me, please?
Hello, I followed the method you provided but I'm receiving an error. It says "A file with the name Shared Documents/*****/fileName.pdf already exists.
Hi @philifova ,
Sorry,
The above method can only change it to FileNama(1).xlsx, FileNama(2).xlsx when it has the same file name as FileNama.xlsx. . . . . . .
Please try @SudeepGhatakNZ's approach
His method is better suited to your needs
Best Regards
Cheng Feng
Just as I added two actions, you can instead add two scopes.
Each scope would have a Create file action followed by a set variable action (where you can save the create ID).
You could then just reference the variable instead of referencing the ID from the action. Makes sense?
Hello,
The one you provided actually works as well, but the problem is I'm referencing the Id of create file to get the list rows and table. Hence, if there two create file flow how can I reference the right Id?
In the example I provided above, I am appending utcnow() to the filename, so it will always be unique.
I have a follow up question, the flow you provided actually works but if the user upload the same file again for the 3rd time. the file name is same filename(1).xlsx that will trigger an error to my flow.
It should be filename(2).xlsx, since filename(1).xlsx already exist.
Hi @philifova ,
Do you want:
1. Determine whether there is filename.xlsx
2. If yes, change the name to filename(1).xlsx when [Create file]
Here is a test for your reference:
Here is library:
Here is flow:
Not sure what your trigger is, I use a manual trigger to enter the filename and file content
Use Filter Query to filter out files with the same name in the folder.
If the Value length is greater than 0, modify the file name when creating the file
Here is result:
Best Regards
Cheng Feng
Will the following work?
The second Create file action has Configure run after properties been set to execute if the action above fails.