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 / Cannot call Office Scr...
Power Automate
Unanswered

Cannot call Office Script from SharePoint

(1) ShareShare
ReportReport
Posted on by 9

Hi, 

 

I noticed that Office Scripts are being stored in One drive instead of a separate repository.  

 

I would like to have a shared repository that will not be affected if the creator leaves or transfers to another account. I was checking on SharePoint, but it seems that scripts stored there are not accessible. 

 

Is there are work around for this? Hopefully it can be included in the future. 

Categories:
I have the same question (0)
  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Hi there, 

     

    OneDrive is one of the options, but you should be able to select other sites from the dropdown in the Run Scripts action for Excel.

     

    Rhiassuring_0-1668735514578.png

     

    Do you mean something else?

     

  • Raphie12282021 Profile Picture
    9 on at

    Hi there, 

     

    I've been testing. And I found that the scripts showing in the drop down "Scripts" is from my One drive. The Location and "Document Library"  and "File" parameters identify on which file the script will be applied to. But its not really specifying the location of the scripts being run. 

     

    So you can run the script on a separate file but you cannot use a script outside One Drive. 

     

    Also, upon double checking even MS learn has indicated that Scripts saved in SharePoint aren't accessible via power automate. 

    Raphie12282021_0-1668736218715.png

     

    https://learn.microsoft.com/en-us/office/dev/scripts/develop/power-automate-integration

     

     

     

     

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Hi again, 

     

    I hope I'm not getting myself super confused here but like ... this works. I can connect to it, I can run the script, it runs as expected. Do you mean something else? Am I confused?

     

    Rhiassuring_0-1668737520757.png

     

    EDIT: OH! I see what you're saying. And yes, I am confused. I see that OneDrive has loaded the script into itself in the background. It sourced it from SharePoint, but it then gets loaded into OneDrive. 

    The fact that it didn't exist in OneDrive to begin with, though, makes me curious. Let me also try some stuff.

     

  • Raphie12282021 Profile Picture
    9 on at

    Have you checked where your .osts files are being saved in your office script editor?  Try doing a save script as. The default location for the scripts in one drive under my files --> documents --> office scripts. These are the files that will show up in my run script command in power automate. Files outside of this repository are not showing under the available scripts for the run script command. 

     

    Raphie12282021_0-1668738138683.png

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Yeah, I'm testing through that right now.  

     

    I guess the work around would be to load all of your OSTS that do get saved to OneDrive into SharePoint, and just teach people THAT is the repository, but it must be loaded to their OneDrive to use. 

    Or, use a shared OneDrive connection for an OSTS Service Account of sorts, that everyone can read from. 

  • Raphie12282021 Profile Picture
    9 on at

    But even saving the .osts in sharepoint wont allow the script to appear under to the power automate run script options as per my testing. The run script still searches the office scripts repository. 

     

    Service accounts would require additional cost and approvals. If you handle multiple client accounts, teams or environments which require isolation, it would make things more difficult. 

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Oh I totally agree with you.

     

    And RE: SharePoint, I know you can't run it from there, I'm saying you could still use it as a repository that people can save to and pull from, but just ensure they are taught that it will go into their OneDrive (like you just taught me 😛

    Not ideal, but a good hold-over until access directly through SharePoint is available. 

     

    And, it kind of makes sense that it isn't -- imagine everyone sourcing from the same script and one person decides to change it just a bit.. eek. But I suppose that's true for any flow...

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard