Overview
When creating batch files to run reports it is possible to have the finished versions of these reports save out to an external SharePoint site. This article will cover how to set the reports to be saved out to a folder in an external SharePoint site.
Details
To configure batch files to save the report outputs to an external SharePoint site, there are two additional columns that you will add to your batch file. These will need to be inserted before any of your Report Options columns. The two columns that you will add will be called:
-
Output Collection Id
- This will represent the document library in the external SharePoint site that the reports should be saved to
-
Output Collection Path
- This will represent the path that you want the reports to be saved to (e.g. Folder 1/Folder 2 which will save the report inside Folder 2 which lives inside of Folder 1
How to Get the Output Collection ID
The "Output Collection ID" is stored by Cosmos and is a way to programmatically link to your external SharePoint site. To get this value, you can go into the Shared Finished Reports section in Cosmos, which points to any external SharePoint sites, that you have access to, and click on one of the items in there such as an Excel file. It doesn't matter which one you click on as they will all have the same Output Collection ID.
Clicking on the file will take you to the Technical Details page for the item where you will see the Item Collection ID. You will copy this and paste this into the Output Collection Id column that you added into your batch file. This points to the overall document library in SharePoint.
Specifying the Output Collection Path
The Output Collection Path represents the folder path that you want to save the finished Cosmos reports in. For example, if you had several folders such as Level 1 and inside that folder you have Level 2, you would enter this in the format of Level 1/Level 2.
One these have been added you can schedule and/or run the batch and you will see that all of the reports will be saved in your external SharePoint site.
Creating Dynamic Folders
When specifying the Output Collection Path you can also specify dynamic folders, so if you have a report option of 6/30/2025 in the batch file and want to drop the contents into a folder called "June 2025" you would leverage Excel to format the date in the way that you want and append that to the Output Collection Path. Cosmos will check to see if that folder exists and will create it if it doesn't. This way you can dynamically specify and create folders as needed in the external SharePoint site without them needing to already exist.
Comments
0 comments
Article is closed for comments.