Fix Missing Office Scripts in the Logic Apps Run Script Action
Question details
The user needs to make Office Scripts stored in a shared SharePoint location available to a Logic Apps automation that uses a service account.

- Product
- Microsoft Logic Apps and Excel Office Scripts
- Device & OS
- not provided
- Scenario
- A service account can open a SharePoint site and Excel workbooks, but scripts stored in an Excel template do not appear in the Logic Apps Run Script action. The scripts appear when personal credentials are used.
- Observed behavior
- The standard Run Script action lists scripts associated with the current user's OneDrive for Business instead of scripts stored in the shared SharePoint location.
Confirm which account is used by the Logic Apps connector and note the exact SharePoint site, document library, folder, workbook, and script name. Verify that the service account can open the target workbook and has permission to use the script location.
Use Run Script from SharePoint library for shared Office Scripts
Use this option when the script is stored in SharePoint and must be available to a service account or shared workflow.
The standard Run Script action generally displays scripts from the connected user's OneDrive for Business Documents/Office Scripts folder. SharePoint access alone does not automatically add scripts from a shared library to that list.
The SharePoint-specific action targets the library where the script is actually stored, so the workflow does not depend on the personal OneDrive script list.
In the Azure portal, open the Logic App that contains the automation, select Designer, and locate the Excel Online action that runs the script.
Remove or edit the standard Run script action, select Add an action, search for Excel Online (Business), and choose Run script from SharePoint library.
In the new action, select the service account connection, choose the SharePoint site and document library, and specify the workbook and Office Script stored in that location.
Select Save, run the workflow with Test or Run, and confirm that the service account can open the workbook and execute the selected script.

Store a copy of the script in the service account's OneDrive for Business
Use this option when the workflow must continue using the standard Run Script action and the script can be managed under the service account.
Use WPS Office for Compatible Excel Workbook Editing
WPS Office does not change Microsoft Logic Apps connector permissions or make Office Scripts appear in a SharePoint action. However, it provides a free, lightweight way to open, edit, and review compatible Excel workbooks while you manage the automation and script permissions in Microsoft 365.
- 1. Download WPS Office: Select Download WPS Office Free and install WPS Office on your supported device.
- 2. Open the workbook: Launch WPS Spreadsheet, select Open, and choose the compatible Excel workbook downloaded from SharePoint or OneDrive.
- 3. Review and edit the file: Use the spreadsheet interface to inspect workbook data, formulas, and layout, then select Save or Save As to preserve the XLSX format.

Frequently Asked Questions
Why does the Logic Apps Run Script action show scripts for my personal account but not the service account?
The standard Run Script action usually lists Office Scripts from the connected user's OneDrive for Business Documents/Office Scripts folder. A service account may have SharePoint access without having those scripts in its own OneDrive script folder.
Which Logic Apps action runs an Office Script stored in SharePoint?
Use Excel Online (Business) and select Run script from SharePoint library. Choose the service account connection, then specify the SharePoint site, document library, workbook, and script.
Do SharePoint permissions automatically make Office Scripts appear in Run Script?
No. Permission to open a SharePoint site or workbook does not necessarily change the script list used by the standard Run Script action. The script must be in the connected user's OneDrive script folder or be targeted through the SharePoint library action.
Can I keep using the standard Run Script action with a service account?
Yes, if the required script is saved in that service account's OneDrive for Business Documents/Office Scripts folder and the Logic Apps connector uses the same account. Refresh the connection and reopen the action after moving the script.




