ForEachFileInFolder is trying to pick a file which is no longer in the folder

Hi everyone,

I’m running into a problem with a scheduled automation that use a combination of Power Automate → UiPath on SharePoint/OneDrive. UiPath runs on a virtual machine that has access to SharePoint and the folder/files I’m using are synced to this VDI/account.

The workflow is set up like this:

  1. E-Mail with attachment comes in (the file name chages every week)
  2. Power Automate moves existing file (from last week) to the sub-folder ‘Archive’
  3. Power Automate saves the new attachment to the main folder
  4. Orchestrator is set to execute the process 30 minutes after the report comes in
  5. Log in to a certain website (which later uses the data from the report)
  6. ForEachFileInFolder should now use the new report
  7. Save data to data table and write the value

Now what happens is that everytime the Orchestrator starts the process, it keeps trying to use the file from last week - not the latest one.

My assumption is that I’m running into an issue with VDI using synced files, as the ForEachFileInFolder looks for ‘C:\Users…’ but the local OneDrive folder shows the correct file and ‘include sub-folders’ isn’t checked. But it worked for 4 weeks and only by looking at the logs I noticed that for last 2 weeks it tries using the file from week before - even though this file is now in the sub-folder.

Any pointers are welcome as I’m still quite new to UiPath :slight_smile:

Can’t you specify the OneDrive folder instead of the local folder?