I am working on a Power Automate Run Script process which takes a number as a parameter and outputs a JSON object. I am having an error of "Script not found. It may have been unshared or deleted" whenever someone other than me is running the flow. The flow is triggered from PowerApps.
Here are the things I have done so far:
1. Made sure that workbook is shared and has edit (the person is even the owner now of the folder and the file itself)
2. Made sure that the script is shared enabled also
3. I even shared the power automate ownership to the person
4. Tested with other person with same permission configuration
5. Tested to run the script by its own both by me and that person and it's running okay except if the person run it through power automate
What's the script do? Do you mind sharing the script?
How about trying to delete the script then recreate a new one to test?
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
What the script does is to create an array of object, shuffle it, and get the top items in the list.
I tried recreating it as well.
Here is the script:
Hi @rmprecioso ,
Unfortunately, at this moment, the Run script action can only access and execute the scripts created by yourself but not shared scripts.
Therefore, when you're sharing a flow with other people, you'll need to also share the original connection (the one created under your name) embedded in that flow. The original connection can make sure the action will run on-behalf-of you so it can have access to your script.
This is the default sharing behavior in Power Automate so presumably it should work for you. But can you please double check if the embedded connection is still pointing to your account?
Please see if the steps below can solve the problem:
1. On the details page of the flow, click the "Edit" button next to "Run only users":
2. On the "Manage run-only permissions" panel, make sure to select "Use this connection (...)" from the "Connection Used" dropdown list.
3. Save the settings
4. Ask another user to try it again.
These settings will make sure the flow runs on-behalf-of the original owner of the flow.
Hope this helps!
Thanks a lot for your response! Definitely, this solution will be helpful on some of my flows. But Unfortunately, there is no option as "Run only users for me" since I use the trigger as "PowerApps". I guess this is valid only with some of the triggers.
Do you have any idea how can we make sure a flow which has a PowerApps trigger will run on the behalf of the owner, not the user?
Thanks a lot!
Hey @Serbay ,
Yes indeed it seems the "Run-only" settings only supports very few triggers (the manual button trigger being one).
I did a bit experiments and figured out a solution that worked for me -
* Firstly, you'll need to create all your flows and PowerApps apps within a "Solution". You can create a new solution from "Solutions/New solution":
* Within this new solution, create a button-triggered flow that runs Office Scripts. Let's call it "Child flow". Please note this flow requires to have a last action to respond to a PowerApp or flow.
* Configure this child flow with run-only users settings as described in my previous response. Make sure to choose "Use this connection ...".
* Within the same solution, create another flow with the PowerApps trigger. This flow will be triggered by your PowerApps app. In this flow, add a step to run the child flow you've just created above:
* Within the same solution, create your PowerApps app. Configure your PowerApps button to run the second flow (the parent flow).
* Now share the PowerApps app with another user, ask them to try it out, and see if the Run script action in the child flow can work properly.
Hope this can also work for you!
I really appreciate your help and responses. I have a single obstacle now, How can we pass the output of one of the actions from PowerApps triggered flow into child flow? I need to use the body of the parse JSON action in child flow.
Hey @Serbay -
Please see if this works:
* In the child flow, add a text input (or whatever input type you need) to the manual trigger. Let's call it "Input". And pass that input value to the consuming actions after it. For example, here I'm passing it directly to the Run script action:
* In the parent flow (the PowerApps triggered flow), a new argument named "Input" to run the Child Flow will show up.
Check out the new Process Advisor community forum board!
Check out new user group experience and if you are a leader please create your group
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks
Check out how to claim yours today!