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
I highly appreciate feedback and support
best regards, guenther
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):
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?
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.