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 / Action 'Run_script' fa...
Power Automate
Suggested Answer

Action 'Run_script' fails with error "Script not found"

(0) ShareShare
ReportReport
Posted on by 5
Combine worksheets into a single workbook
 
I would like to create a power automate flow that reads information from an excel file and writes those information into another.  So, I have been trying to run the above sample, first.  In my environment, if the first 'Run script' action succeeds, the second 'Run script' always fails with 'Script not found' error.  To find out the reasons, I have tried various patters, but I still don't have any clues.  I would appreciate it very much if you could possibly tell me how to fix it.
 - The scripts are selected using the Designer's GUI. I cannot understand the error message: Script not found. Please confirm that the script was saved correctly, is still shared, and hasn't been deleted. 
 - Re-selecting scripts using Designer doesn't help.
 - Saving scripts in SPO and using 'Run script from SharePoint library' instead doesn't help.
 - Saving excel book in SPO doesn't help.
 - To narrow down the reason, I made a very simple flow like below image.  Even the first 'Run script' fails.  
 - Scripts are very simple like these.  Adding parameter into main() function doesn't seem to affect the error.
20251205-01.jpg
20251205-03.jpg
20251205-02.jpg

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,978 Moderator on at
    Hi @Masa
     
    So I went and built the example and it worked fine for me.
     
    NOTE: 1 little change in my pictures, its late I am being lazy. Before I ran this I moved my combination file to another folder and then ran it all. SO the picture of all 3 in the same folder is wrong, but everything else is the same.
     
    So a couple of things
     
    1. If you click View Scripts, Recent, does it look like this? so that you verify the exact name of the scripts?
    2. Did you rename one of the scripts after you already attached it to an action in PA? If so you have to remove it and start again as that will cause it to fail.
     
    The above is my scripts in my file below (pictures)
     
     
    I added to files to this folder
     
    Here is my flow.
     
    My File
     
    Please verify you didn't change the name of the script after you already saved it and added it to your flow. If so redo it. But it works fine for me. Also make sure you saved the script in your onedrive and NOT sharepoint because then you have to use the sharepoint script action not run script.
     
     

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • Suggested answer
    Masa Profile Picture
    5 on at
    Thank you for your reply, @Michael E. Gernaey.
     
    I have tried re-selecting the scripts / re-adding 'Run script' action sevral times, but my flow doesn't work correctly.  I think power automate service may have some problems that happens in a certain condition.  Maybe something in my company's security system would be interfering with executing flow.
  • Michael E. Gernaey Profile Picture
    53,978 Moderator on at
    Hi @Masa
     
    I don't think its Power Automate, I would have to see a video of what you are doing to tell you what is being done incorrectly, unfortunately there isn't enough background validation, but I've now redone it 3 times, each time taking less than 8 minutes (and I'm slow lol) and its not a problem in any of my tenants or environments. (Gov, DOD, Def, High GCC, or standard).
     
    If you record it I am happy to review what you are doing though if you like.
  • Masa Profile Picture
    5 on at
    Hi, @Michael.
     
    I appreciate your suggestion very much.  
    I recorded a video while reproducing the error today.  I select the scripts from OneDrive, save the flow, start testing the flow, and 'Script not found' error occurs.
     
            
    Now, 'Image' button is available in the editor, so I put the images above.
     
    I have changed the flow and scripts from the sample.
    • The 1st action 'Copy file' is an initializer.  It overwrites new.xlsx, a target file by a file from another folder to get rid of added sheets.
    • In the 2nd action 'Run script', 'sample - add sheet2' is executed.  The script has a parameter to specify the sheet name added to the target file.  When I re-selected the script, Power Automate Designer looks like recognizing the script correctly because Designer requests 'ScriptParameters/worksheetName' to input.
    • In the 3rd action 'Run script 1', 'sample - add sheet3' is executed.  The script doesn't have a parameter to specify the sheet name, but has it inside the script.  That is to intend to avoid interface error between the flow and the script.
    • I haven't edited the office scripts since last week.
    Thank you!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 881

#2
Valantis Profile Picture

Valantis 823

#3
Haque Profile Picture

Haque 485

Last 30 days Overall leaderboard