web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow with “Run Script ...
Power Automate
Suggested Answer

Flow with “Run Script (Excel Online)” action fails to enable after deployment to managed solution

(1) ShareShare
ReportReport
Posted on by 16

Title: Issue enabling flow with “Run script” action after deploying solution to managed environment

 

Description:

Hi,

I’m facing an issue while deploying a flow that uses the Run script (Excel Online) action from a development environment to a client’s managed environment.

Error:
Flow save failed with code 'MultipleErrorsOccurred' and message 'The dynamic operation request to API 'excelonlinebusiness' operation 'GetSingleScript' failed with status code 'NotFound'. This may indicate invalid input parameters. Error response: { "status": 404, "message": "Script not found. It may have been unshared or deleted.\r\nclientRequestId: 0d036ccd-7d73-4b07-abf0-7d4c921c72a8", "error": { "message": "Script not found. It may have been unshared or deleted." }, "source": "excelonline-uks.azconn-uks-002.p.azurewebsites.net" };The dynamic operation request to API 'excelonlinebusiness' operation 'GetSingleScript' failed with status code 'NotFound'. This may indicate invalid input parameters. Error response: { "status": 404, "message": "Script not found. It may have been unshared or deleted.\r\nclientRequestId: 0d036ccd-7d73-4b07-abf0-7d4c921c72a8", "error": { "message": "Script not found. It may have been unshared or deleted." }, "source": "excelonline-uks.azconn-uks-002.p.azurewebsites.net" }'.Upgrade 
 
Screenshots: 


Scenario:


  • Flow was developed in a Dev environment (unmanaged)

  • Solution is deployed to Client environment (managed)

  • Flow includes Run script action (Excel Online)

Issue:
After deployment, the flow does not turn on in the client environment. When trying to enable or save the flow, I encounter an error (while validating the Run Script action).

What I tried:


  1. Used environment variables for:
    • File ID
    • Document Library
    • Script ID
      → Still received error
  2. Removed environment variables in client environment and manually reselected
    • File
    • Library
    • Script
      → Same issue occurs while savin 

Additional Info:


  • The Excel file and script exist in the client environment
  • Permissions seem to be in place
  • Issue only occurs post-deployment (works fine in Dev)

  •  

Ask:

Has anyone faced issues with the Run script action in managed environments?

Is there any known limitation, dependency, or configuration required when deploying via solutions?

 

Any guidance would be really helpful.

 

Thanks in advance!

I have the same question (0)
  • 11manish Profile Picture
    3,333 on at
    It seems that this issue occurs because the Excel “Run script” action depends on Office Scripts that are user-scoped and not solution-aware,
     
    so their references do not carry over during solution deployment.
     
    The recommended approach is to recreate or rebind the script in the target environment after deployment, ensuring proper permissions and connections.
  • SB-01070651-0 Profile Picture
    16 on at

    Hi @11manish,

    Thanks for your response.
    I’d like to clarify a few important points in my scenario:
     
    - The Office Script used in the client environment is different from the Dev script — it is created separately in the client environment.
    - During solution import, I am providing the correct Script ID via environment variables, pointing to the client environment script. 
    - So this is not about references carrying over from Dev — I am explicitly rebinding it in the target environment.
     
    Also, an important observation:
     
    - The same setup (using environment variables for Script ID, File, and Library) works perfectly in the Development environment
    - The issue only occurs after deployment to the managed (client) environment
     
    Additionally:
     
    - The script is created using a service account, and the same account is used for:
    • Deployment
    • Connections
    • Flow ownership
    So permission or ownership mismatch is unlikely.
    What’s more:
    • Even after removing environment variables completely
    • And manually re-selecting:
      • File
      • Document Library
      • Script
    The error still occurs while saving the flow, with: GetSingleScript → 404 (Script not found)
    This suggests the issue is not just with environment variables or solution references.
    It seems more like:
     
    - The Excel Online connector is unable to resolve script metadata correctly in the managed environment
    - Or there is some backend validation/caching issue during the save operation
     
    Has anyone experienced a case where:
     
     - Script is visible and selectable in UI
     -  But fails during save/enable with Script not found?
     
    Any deeper insights or workarounds would be really helpful.
    Thanks!
  • 11manish Profile Picture
    3,333 on at
     
    Yes, this exact scenario can occur where the script is visible and selectable in the UI but fails during save with “Script not found.”
     
    It seems that this is typically caused by backend validation and metadata resolution issues in the Excel Online connector within managed environments.
     
    Even when Script ID, permissions, and ownership are correct, the connector may fail to resolve the script due to caching, drive context mismatch, or known
     
    platform limitations.
     
    The most reliable workaround is to recreate the script (and sometimes the Excel file) directly in the target environment and rebind it using a fresh connection.
  • Suggested answer
    Haque Profile Picture
    3,653 on at
     
    Let's analyze the root cause from the error message you’re seeing:
     
    The crux par of the message is: "Script not found. It may have been unshared or deleted." When this error comes with the status code 404 from the GetSingleScript operation means that the flow’s Excel Online Run script action is trying to call an Office Script that either:
     
    1. Does not exist in the target environment 
    2. OR: Has not been shared with the user or service account running the flow
    3. OR: Was deleted or renamed after the flow was created
     

    Where we should be vigilant to fix this:

    1. Verify the Office Script exists in the client environment: Open Excel Online in the client’s tenant. Go to Automate tab → All Scripts. Confirm the script your flow references is present and correctly named.
    2. Ensure the script is shared or accessible: The script must be saved in the client environment’s OneDrive or SharePoint where the flow runs. The user or service principal running the flow must have permission to access and run the script.
    3. Update the flow’s Run script action to reference the correct script: If you exported/imported the flow, the script ID or name may not match. Re-select the script in the Run script action inside the client environment to refresh the reference.
    4. Check workbook location and permissions: The Excel workbook must be stored in OneDrive for Business or SharePoint Online in the client tenant. The flow’s connection must have access to the workbook and script.
    5. Re-publish or re-save the script if needed: Sometimes re-saving the script in the client environment refreshes its availability.
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!

     

  • SB-01070651-0 Profile Picture
    16 on at
    Thank you @Haque for your suggestions.
     

    I have already verified the points mentioned, and the Office Scripts are indeed present in the client environment.

    The service account used to deploy the solution is also the owner of these scripts, so there are no accessibility or permission issues.

    Additionally, I am able to successfully view and select the script within the Run Script action in the UI, which confirms that the script exists and is accessible to the user.

    However, despite selecting the correct script, the issue persists and I continue to receive the same error.

    Please refer to the screenshots shared above for more context.

  • SB-01070651-0 Profile Picture
    16 on at
    Yes, you are correct @11manish this does appear to be a platform limitation, and it’s exactly what I’m experiencing at the moment.
    I have already tried removing the existing Run Script action and adding a new one, but that did not resolve the issue.

    As suggested, I will now try creating a new script in the target environment and rebind it with a fresh connection.

    I’ll update you once I’ve tested this approach and let you know if it works.

  • Suggested answer
    Haque Profile Picture
    3,653 on at
     
    If you capacity - let's go and create support ticket soon.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard