Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Excel Connector - Run Script Operation / using custom value for Script

I am trying to use the run-script operation from the Excel-Online (Business) connector with a dynamic script reference.




I have tried to use the One-Drive for Business connector with the Get file metadata using Path and use the Id of the script-file and pass it as script value and unfortunately it did not work  


message""Script identifier format was invalid.\r\nclientRequestId: ...",


I highly appreciate feedback and support 

best regards, guenther

Frequent Visitor



May I know how you can get the 'Document Library' ID? from Peek Code it is different from the GUID of the Document Library in SharePoint.


The id returned from the "Get file metadata using path" action is in this format "b!ZwIX*******.01FSU****" but we only need the part after ".". You can use the split() expression to extract the second part and prefix it with "ms-officescript%3A%2F%2Fonedrive_business_itemlink%2F". The final script id should look something like this: "ms-officescript%3A%2F%2Fonedrive_business_itemlink%2F01FSU****".


For @Cyris_Lai 's question regarding the document library, I myself used the technique described in this post:


Basically, I used the "Send an HTTP request to SharePoint" action (within the SharePoint connector):



This returns a JSON string with an array of { "id": "...", "name": "..." }, representing all the document libraries on that SharePoint site. I then used a few different Data Operation actions (Parse JSON, Filter array, Compose) to parse this JSON string, filter it based on the name of the document library I needed, and extract the id field. This id field is what you need to provide for the "Document Library" field on the "Run script" action.


But I'm wondering if there could be other better solutions. @guenthi do you mind sharing how you managed to get the dynamic reference to the document library?

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,307)