web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SharePoint For A Selec...
Power Automate
Unanswered

SharePoint For A Selected Item only works if PowerAutomate Flow is in the Default Environment

(1) ShareShare
ReportReport
Posted on by 1,302

Hi

 

Am I correct in assuming that SharePoint "For A Selected Item" only works if the PowerAutomate Flow is in the Default Environment ?

 

Is there a way to trigger on when a List Item (Or Document in a Document Library) is selected into a PowerAutomate Flow which is not in a Default Environment ?

 

I have tried both the List Name and the List GUID in For a Selected Item trigger.

 

As a company we discourage the use of the Default Environment other than as a "PlayPen".  Definitely not to be used in a Production Environment.  All PowerAutomate Flows and PowerApps in Production must be in their own environment with appropriate DLPs applied.

 

Regards

 

Nigel

Categories:
  • yashkamdar Profile Picture
    1,044 on at

    Hello Team,

     

    Am I correct in assuming that SharePoint "For A Selected Item" only works if the PowerAutomate Flow is in the Default Environment ?

     

    Yes you are correct,  you cannot trigger Flows that have MANUAL trigger or that need to be triggered on Selected items via any environment other than the DEFAULT environment.

     

     

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

     

     

  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    Hey @NigelP 

     

    I gave it a try and it did not work for me. I also see that other customer are facing similar problems, https://powerusers.microsoft.com/t5/Building-Flows/quot-For-a-selected-item-quot-Flow-only-works-in-default/td-p/176488

     

    I can think of a Work around you can create a Flow Launch button using column formatting, https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#create-a-button-to-launch-a-flow 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • NPrice99 Profile Picture
    1,302 on at

    Hi @yashkamdar 

     

    So this means I will have to have one PowerAutomate Flow for each Document library and List in my SharePoint Online Estate - currently at around 1628 Document Libraries and Lists which have SP2010 Approval workflows on them according to the PnP Migration Tool !

     

    Thats going mean navigating the Default Environment interesting !

     

    Regards

     

    Nigel

  • NPrice99 Profile Picture
    1,302 on at
  • yashkamdar Profile Picture
    1,044 on at

    Hello Team,

     

    Unfortunately there is no easy way out of this. To be honest there are complicated ways and I do not want to mention them because everything comes with a limit anyways.

     

    I would have asked you to Clone your Flows meaning Make a copy of your Flow but even that has a limit of 500 right now.

     

    I would recommend you to discuss this with Support and check if they have something in place for this scenario, this looks pretty specific.

     

    https://flow.microsoft.com/en-us/support/

     

  • powercorner Profile Picture
    477 on at

    Hello @yashkamdar , @CFernandes @NigelP ,

    Is the information above up to date?
    We cannot use "Selected Item Trigger" outside of default environment?

    Honestly, we are talking about ALM and create environments, take care about the governance and now this? Kind of a neckbreaker!?

     

    With regards
    Kevin

  • marcodeluca Profile Picture
    23 on at

    Hi @powercorner,

     

    I totally agree with you. We are currently introducing Power Platform to our Company. We defined an environment strategy, governance documentation and an ALM process. Now we are facing the same Problem. SharePoint is our main DMS and we have a lot document based workflows, that are business critical. So we need to trigger many Flows starting from Documents or List-Entries. 

    ALM does not work in that case because of the known limitations (SharePoint and also Teams triggers - For a selected item/file/message - do not work in other environments).

     

    As a Workaround for the really critical Flows we started to create "Dummy Starter" Flows. They run in the "Default environment" (which, by the way, we have renamed to 'Personal Productvity' according to MS recommendation) and trigger the main Flows (ALM aware) via HTTP REST. But this means, that you need Premium Licenses to call the main Flow.

     😞

     

    Best Regards

    Marco

  • CU18061035-1 Profile Picture
    18 Microsoft Employee on at

    @NigelP 
    Did you find any acceptable solution?

     

    I read over the article by John Liu. It suggested using the List GUID ID for the "For A Selected Item" when trying to get a Flow to show up in a SharePoint Site Pages Library, but I still think it was using the Default Environment. I did try using the List ID when I saved a Flow from a different Environment, but the Flow did not show up in the Context Menu.

     

     @NigelP  - Were you able to get a Flow published in an Environment other than the Default Environment to show up in the Context Menu?

     

    One of the benefits of creating a Flow with the SharePoint "For A Selected Item" trigger is that it adds the flow to the Context Menu and it is Security trimmed.

     

    Others ( @CFernandes ) have suggested creating a button using Column JSON formatting which does work but it lacks the ability to put any Security trimming in place. If the button is clicked by a user without permission to run the flow, the flow dialog just never shows up.

     

     @marcodeluca 
    I am interested in more information on the workaround you suggested for using a "Dummy Starter" Flow. How did you identify the correct Environment to run the main flows in (assuming that you have created a Solution that is promoted via ALM to your other Environments of Dev, Staging, and Prod)? How many Premium licenses did you find that this set-up needed?

     

    I have also looked at other solutions such as using SPFX to create a ListView command. This implementation would need to launch the flow via an HTTP REST call resulting in the use of Premium Licenses.

    It seems the best solution for this issue would be for the Microsoft SharePoint team to add the ability for a Site Admin to select the Power Platform Environment in a setting that the Context Menu would use in it's query to build out the list of Flows for a list.

     

     @yashkamdar 
    I have to disagree with you regarding "this looks pretty specific". I guess this goes back to how the Power Platform should be viewed. It is a full fledged development environment where a company would want to have a traditional dev, staging, and production environment. Or should it be viewed more as a citizen developer platform where no one ventures out of a default environment. I think this is an important product enhancement that is best supported by the developer who coded the Context Menu in SharePoint who never realized that there would be an Environment other than the Default one.

     

    Best Regards

    Mark

  • marcodeluca Profile Picture
    23 on at

    @MarkBandR 

    We discarded the idea of using the dummy flows, because of the premium licenses. Since I am not a licensing expert I do not recommend you to rely on the info I provide you in this post, but for us according to our TAM: every potential run-only user needed a premium license. Too much for us. So we decided to start the flows via "Flow-Button" using JSON-formatting of a column. For us this means, that we need to manage the start Workflow buttons ourselves.

    Exactly, we have DEV, TEST and PROD environments. The correct flow is identified using the Flow Identifier. At the moment we are working on deploying the flow button column (including the JSON formatting) via PnP Provisioning engine as part of our CI/CD pipeline (wich unfortunately is still under construction).

  • CU18061035-1 Profile Picture
    18 Microsoft Employee on at

    @marcodeluca  Thanks for the reply.

    I looked more at using a Flow-Button using the JSON column formatting but I wanted the button to only show up if the user had Permission greater than Read. [$PermMask] is available for this.

     

    @MichaelBoehnke documented this here:

    https://techcommunity.microsoft.com/t5/sharepoint/column-formatting-show-or-hide-columns-based-on-user-permission/m-p/3017542

     

    (Thanks @MichaelBoehnke )

     

    These are some of the values for [$PermMask] based on the users Permissions:

    Full Control     0x7fffffffffffffff

    Design             0x1b03c5f1bff

    Edit                  0x1b03c431aef

    Contribute      0x1b03c4312ef

    Read                0xb008431061

    View Only        0xb008431041

     

    This even works at the item level.

     

    Below is an example of Column formatting to show a Flow-Button if the user has Permission greater than Read to the Item:

    {

      "$schema": https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json,

      "elmType": "button",

      "customRowAction": {

        "action": "executeFlow",

        "actionParams": "{\"id\": \"YOUR_FLOW_ID\"}"

      },

      "attributes": {

        "class": "ms-fontColor-themePrimary ms-bgColor-themeDark--hover ms-fontColor-themeLighter--hover .ms-ContextualMenubutton"

      },

      "style": {

        "cursor": "pointer",

        "display": "=if([$PermMask]>='0xb00', 'none', '')"

      },

      "children": [

        {

          "elmType": "span",

          "attributes": {

            "iconName": "MicrosoftFlowLogo",

            "class": "ms-font-xxl"

          },

          "style": {

            "padding-right": "6px"

          }

        },

        {

          "elmType": "span",

          "txtContent": "Start Flow"

        }

      ]

    }

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 299

#2
11manish Profile Picture

11manish 274 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard