Hi All,
I'm trying to set up a 'rename flow' for pdfs dropped into a folder in Sharepoint.
Any given pdf in question will always contain the string '1.pdf' to '72.pdf' in their file name, and I want the flow to detect when the file is dropped in a folder, get the file, and create a new file (with the original files content) in an 'Output' folder with the name 'Page1.pdf' to 'Page72.pdf'.
I'd rather not have to create an 'if' condition for 72 different scenarios, so I've instead got an:
- 'Initialize variable' action, named 'PageNumber' with an integer starting at 0,
- a 'do until' action set to '72'
- An increment variable action
- Then a condition set to 'File Name' contains expression:
concat(variables('PageNumber'),'.pdf')
To test the flow, I'm dropping in a file named 'OM302120-001.pdf'.
The resulting file should be named 'Page1.pdf'
However, my condition is always returning false, and as such, no file is created.
Here is the full flow:
Part 1
Part 2
Any ideas where I'm going wrong?
Cheers in advance!
Chris