Dec 28 2023 04:58 AM
Hi all,
I have a Power Automoate flow that I use to move files from one folder to another.
I check whether the folder number in a "Number" column corresponds to the column in another folder to ensure that the moved file ends up in the right folder.
I therefore have a condition in my Power Automate flow that loops over all the folders until it finds a match before moving my file.
The problem is the execution time. It takes about 2 minutes for the flow to run. How can I optimise this?
Dec 28 2023 06:32 AM
Hi @LouisT645 , have you considered using an expression to generate the destination folder path and moving based on that, avoiding the condition? I appreciate you may be wanting to ensure a destination folder exists.
Dec 28 2023 07:10 AM
Dec 28 2023 11:48 PM
Hi @LouisT645 , my initial interpretation of your question was that the source folder name is numbered. Using that number you could avoid questioning whether the destination folder exists, but I'm now doubting my understanding. Can you expand the detail of the source files/folders and the destination folders?
Dec 29 2023 12:54 AM - edited Dec 29 2023 01:06 AM
@Jon_Lake yeah sure.
I developped multiple Power Automate flows to manage invoices, I have a Document Library with all my invoices and some columns like "name", "Building Number", Property Manager",...
One of my flow is to move the invoice from the folder named "all Invoices" to the folder with all the buildings we manage.
I use the column "Building Number" to find the correct folder to store the invoice in the "accounting" folder ine the correct building.
So I loop on all the buildings numbers and if 2 numbers are the same, the flow store the invoice in the correct building folder
Jan 02 2024 01:09 AM - edited Jan 02 2024 01:12 AM
Hi @LouisT645 , happy new year!
I may have figured out a solution.
My folder structure is setup like this.
All files awaiting re-location would go into the 'source_docs' folder, which looks like this with docs in.
The flow gets all file properties for those files in the source docs folder, then for each it moves it to the folder matching the building name attribute.
This works well, though when you first add the move file action it will create within a child loop, so you do need to drag the move file action out of that child loop, down as a new action within the parent loop. My limited testing has proven successful so far. Hopefully it will help.