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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow script error with...
Power Automate
Unanswered

Flow script error with correct output. How?

(0) ShareShare
ReportReport
Posted on by 25
My workflow creates an Excel file from a Power BI Paginated report, opens the Excel file, then runs a script on the file to create a new worksheet with a pivot table.  The flow is doing exactly what it is supposed to do, but I'm still getting an error.

 
I'm not sure what I need to fix.  There are actions to be added after this, so I need to rectify this error to move forward.
Any help is greatly appreciated!!
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi @RPYee
     
    So looking at it, its not doing what its supposed to as its failing? I don't mean that rudely I mean it as in, am I misunderstanding so I can help better.
     
    Looking at this, I see a Create File (is my guess using the output of your Power BI), then I see Get File Content(can you explain why you are doing that?)
     
    Then you want to run a script.
     
    Is the script already in the workbook? How did it get there?
     
    Or is this a script in another file that knows how to access this file?
     
     
     
  • RPYee Profile Picture
    25 on at
    The script is saved in a file (.osts) in the SharePoint folder and called at the "Run script from SharePoint library" step. It's working just fine, but at the end, I'm getting the message "flow run failed".  The reason I say it's working is that the script completely modifies the original file.  The output file shows me that the script worked.  Don't understand how my output is correct if the flow failed.

    I did a "Get file content" to be able to run the script on it.  It's entirely possible I'm not thinking about this process in the proper way...
     

    .
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi @RPYee
     
    No worries, i have to ask myself each time (did I mean that or lol why did I do that).
     
    My only weirdness is I see you have an error, but you feel like its working, so I am not sure what to resolve.
  • Suggested answer
    rzaneti Profile Picture
    4,241 Super User 2025 Season 2 on at
    Hi,
     
    The error message mentions that you may have an error in the workbook input (file format issue), although the script runs fine. Could you please share the inputs from your Run script from SharePoint library action?
     
    In this meantime, to prevent your flow run to stop due to this error, you can set up the Run after configuration of your action, so your flow will move to the next step even if the Run script from SharePoint library fails. You just have to go to the first action after it and select Configure run after:
     
    And then you can select the scenarios where your flow must move forward to the next step (and even all of them). Since the action is failing, make sure to keep the has failed checked:
     
    Let me know if it works for you or if you need any additional help!
     
    If this is the answer to your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

    Check more Power Platform content on my website.
    Lets connect on LinkedIn.
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard