I'm stumped and it shouldn't be this hard.
I have a flow that I'm using to convert all attached files in a new Sharepoint list item to JPEGs and want to rename them all to the same name with a number at the end (1),(2),(3)...
The Flow is in french so here's the jist of it. When an item is created, I get the attached files and then loop for each convert the file to PDF then convert the PDF to an image list. Then I used the Add attachment to save the attachement with the new name that I want. Obviously, it won't work with multiple attachments since it can't save the same name twice.
Therefore, I added an Initialize variable and then an increment variable to count the For each 1, and add that number in the filename. This works, but if the image list from one of the attachments has more than one image, it doesn't work because again, I'm save the same name with the same integer. I tried to add a second initialize variable and increment variable for the second For each, but it doesn't let me add an initialize variable inside a loop.
For example. My item has 2 attachements. An excel file that converts to 3 images and a photo.
I get the first excel image file as : image(1).jpg and the photo as image(2).jpg. but the 2 other images from the excel don't work because they also will be called image(1).jpg
How can I do this. I would like to have something like : image1(1).jpg, image1(2).jpg, image1(3).jpg and image2(1).jpg
EDIT:
I almost got it.
I added a second initialize variable before the first loop and a increment variable inside the second loop. It kind of works.
What I get now is : image1(1).jpg, image1(2).jpg, image1(3).jpg and image2(4).jpg
It does the job, but I would rather it restarted numbering with subsequent files (image2(1).jpg).
Any ideas?