Hello everyone!
I looked around and didn't find anything that quite fit my specific issue.
Let me describe how my Flow works to give you guys a better understanding. My Flow starts by waiting for a SharePoint item to be created (data patched from PowerApps), and then essentially uses that data to do various things.
One of these things that I want to do is to be able to take the attachments submitted, and then move them to a different SharePoint site (xxx.sharepoint.com/sites/a ----> xxx.sharepoint.com/sites/b). I've been able to do this with no issues, but then a user brought something to my attention.
I've been renaming the file as I move it across, but users want to be able to submit more than one item at a time in my PowerApp. The items get renamed (via Flow) the same thing and all overwrite each other ending with one file.
Is there a way to add in a sequential format of some sort? I'm hoping to be able to rename multiple files to be something like "Timecard-i_reminisce-Date-sequentialFormat". Thanks!
hi @i_reminisce
wow! you are a life saver mate! thanks a lot!
and i hope you did enjoy your holiday...
cheers,
pytbyt
@PytByt , apologies for my late reply, was enjoying my holiday :). Here are my responses:
If you need more details then what I've provided please let me know, but understand that I may not be as quick to respond as things are picking back up at work.
Picture examples of Question #2:
The concat expression is:
concat(triggerBody()?['ID'], ' - ', 'Copy ID Card', '.jpg')
The last expression is:
last(split(items('Apply_to_each')?['DisplayName'], '.'))
Here is the flow run demonstrating the rename of the file:
It may be a bit hard to tell, but the file was uploaded to SharePoint as "FlowTest2.jpg", and then was renamed to "3 - Copy ID Card.jpg" after the Flow run completed.
Hi @i_reminisce
Im sorry for my late reply..
i have a few question:
Thanks.
Regards,
PytByt
This worked for me, let me know if you need explanations as to what is going on in the flow.
The concat formula is
concat(triggerBody()?['ID'], ' - ', items('Apply_to_each')?['DisplayName'])
Here's a picture of the attachments after they've been renamed (couldn't get it to work with .doc, but I didn't spend any time on troubleshooting why... SharePoint was being fussy about uploading one)
Hi @i_reminisce , thank for your reply.
Yes, i'm using powerapps with submitform formula for submitting the the whole form including the multiple attachments into my sharepoint list table.
Please help me.
Best Regards,
PytByt
Hey there @PytByt !
I can give it a shot, but I need to know how you're submitting the pictures to Sharepoint. Are you doing it through PowerApps?
Hi @i_reminisce
can you help me creating a flow that automatically renaming the file attachment that i uploaded into a sharepoint list?
i need to upload multiple atatchments at once for a single record in a sharepoint list, and i need to renaming it all by adding the record ID Column at the front. for example:
ID: 10
Attachments:
A.jpg
b.pdf
C.doc
Rename it so it will be:
10 - A.jpg
10 - b.pdf
10 - C.doc
how i can achieve that? please help.
much thanks,
pytbyt
I figured it out, I just did a CountRows() of the attachments in my PowerApp and submitted that back to SharePoint and used that number in a condition in Flow.
Thanks again for all of the help @SCTdan, I really appreciate it!
The increment variable will definitely be good enough for now, thanks for that!
Now you have me interested in knowing how to add in that logic you mentioned... How would I go about doing something like that? I tried a condition based on the number of attachments being > 1, but it doesn't like it since it is an object and not a number.
Thanks for all of the help so far!
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492