Dear all,
I'm sure I am missing something here and the solution will be real easy and slap me in the face!
However, I'm struggling to wrap my head around how to update a file (in this case Excel) that is located in a sub folder of a Document Library.
The Scenario
Each day, I want to backup a SharePoint list to a particular Excel File. The SharePoint list is one of several lists that are team plans for different teams in a project. Each team plan needs to backup to an Excel file for the current month, and the daily backup is written to a dynamically newly created worksheet.
My difficulty is referencing the existing Excel file in the sub folder. The structure is like this:
- Backups (this is the Document Library name)
- Team Plans Backups
- Team 1
- Team 1 Plans Backup - August 2023.xlsx
- Team 1 Plans Backup - July 2023.xlsx
- Team 2
- Team 2 Plans Backup - August 2023.xlsx
- Team 2 Plans Backup - July 2023.xlsx
The goal is to dynamically create a new worksheet each day in the file for the current team in the current month. I've tried this in a flat folder structure and I can get this working. This also works without a problem if all the files are located at the Document Library root level folder - Backups.
However, I cannot figure out a way to access the files in the sub-folders. I know how to dynamically create the file name to look for using a concatenate expression together with utcNow() function, but I'm struggling to look for that filename in a sub-folder.
Any and all help and advice would be most appreciated!