I am new to the forum and hope someone might be able to help as I cannot find a similar question asked anywhere else. I am trying to design a way that PowerAutomate will work as a revolver, to pick a csv file file from a folder, one file at a time and load into a chamber (Feeder) folder, that Excel VBA is setup to fire!
I want a way to move and rename a csv file with specific (fixed) name within my OneDrive folders. I have been able to do this in PA, when there is only one matching file in my "in_tray" folder (example1). However it might be possible that more than one file will match the conditions - so I want to find a way to build in a delay between each match and rename, to allow the VBA to run and Outlook to send email and reset - 5 mins would be generous for this and acceptable to users. As Example 2, although there are three matching csv files, I want it to pick "joesdata" first - move and rename, then PAUSE, then pick "gregsdata.csv" move and rename Pause etc.
Example-1 Watched folder ''' onedrive/myname/in_tray/joesdata ''' (detects modified file at location, matches partial name and filetype - moves and renames as ''' "datafile.csv" ''' Destination: ''' onedrive/myname/feeder/datafile '''
Example - 2 Watched folder ''' onedrive/myname/in_tray/joesdata ''' ''' onedrive/myname/in_tray/gregsdata ''' ''' onedrive/myname/in_tray/dansdata '''
Sorry for the overly long description - would appreciate any help here (frustratingly, I could do this easily with Hazel for Mac, but I need something to work entirely within MS ecosystem for information governance reasons at work)
Thanks so much for looking!
When you return a list of files that has more than one file in it, it should be in the form of an array. You need to create an "Apply to each" action and put the array there.
The apply to each will loop over each file, and inside the apply to each action you can refer to the individual file that is currently being used with item()['name']
, where name is the name or path of whatever property refers to your filename.
By putting a Delay action at the end of the Apply to Each, you can ensure that Flow will wait five minutes before starting another round.