Learn how to run an Excel office script on a dynamic path using Power Automate. Using the SharePoint rest API we can obtain the drive ID and overcome an error "Unexpected response from the service" when we clearly know the file exists. I will show you how to use an apply to each to loop through the results of the SharePoint API and retrieve the ID dynamically by writing a basic expression.
00:38 An overview of the requirements
01:00 A Sample Office Script
01:45 Buiding the Power Automate Flow
03:02 Dynamic Library and Path on Run Script
03:57 Error: Unable to run script
05:43 SharePoint Rest API
08:00 Apply to Each Document Library
Office Scripts in Excel let you automate your day-to-day tasks. You can create and edit scripts with the Code Editor. Run a series of Excel steps with a single button. Then, share that script with coworkers so everyone can improve their workflow.
To use Office Scripts, you first need to enable the Office Scripts feature in Excel. You can then create a new script by clicking the "Scripts" button in the "Data" tab of the Excel ribbon. This will open the Office Scripts pane, where you can create, edit, and run scripts.
There are many resources available online to help you learn how to use Office Scripts, including Microsoft's official documentation and various tutorials and code examples. You can also find a variety of third-party tools and libraries that can help you create more advanced scripts and automate more complex tasks in Excel.