Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 4

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

 

guenthi_1-1648793507873.png

 

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  

guenthi_3-1648794027707.png

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

 

I highly appreciate feedback and support 

best regards, guenther

  • Yutao Huang Profile Picture
    Yutao Huang on at
    Re: Excel Connector - Run Script Operation / using custom value for Script

    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: https://powerusers.microsoft.com/t5/Building-Flows/Get-drive-id-for-Doc-Library-selection/td-p/85653....

     

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

    Yutao_0-1650048861495.png

     

    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?

  • Cyris Lai Profile Picture
    Cyris Lai 15 on at
    Re: Excel Connector - Run Script Operation / using custom value for Script

    Hi!

     

    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.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard

Featured topics