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.
After Support call from MS support team, I found correct process to add both flows accurately.
1. Create a Child flow with Manual trigger with input -> add initialize variable and set value as input from manual trigger -> Add respond to a PowerApp action -> save the child flow
2. Create a Parent flow using PowerApp trigger -> Add run child flow action -> set value from Powerapp form -> Add respond to a PowerApp action and get input from Run Child flow action-> save the parent flow.
3. Add Parent flow to the Powerapps button.
4. Test your both flow by trying to hit PowerApp button in PowerApps form.
5. If step 4 runs without any error, go for additional action sets in the child flow. Please make sure to add new connection reference on actions and select connection from the "Run only users " link button
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.