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 Apps / How to List Environme...
Power Apps
Suggested Answer

How to List Environments in a Dropdown in Power apps.

(1) ShareShare
ReportReport
Posted on by 20

Hello everyone,

I'm working on a Power Apps application and would like to provide users with a list of available environments that they can select from. Is there any way to dynamically retrieve and present this list within the app? Ideally, I want the users to be able to see the environments they have access to and select one to interact with.

Has anyone done something similar or have any suggestions on how to implement this feature?

Thanks in advance for your help!

Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
    Hi,
     
    So the answer is yes, however they have to be an admin if you want them to do it,
    That or you need to create a Power Automate flow, that runs as a flow and returns them
    Or
    you have a Schedule Power Automate flow that runs every day, and updates a sharepoint list to store environments, then
    have the power app read them from there.
     
     
  • Suggested answer
    swapnilwani20 Profile Picture
    8 on at
    1. Enable the Power Platform for Admins Connector
    In Power Apps (Canvas App), go to Data → Add data → Search for "Power Platform for Admins".
    Add:
    Power Platform for Admins (for environments)
    Power Apps for Admins (for apps)
    Note: You must have Power Platform Admin or Global Admin permissions to retrieve all environments and apps.
    2. Get All Environments
    You can call:
    Classic Combobox-
    PowerPlatformforAdmins.GetEnvironments()
    This returns a table of environments with properties like:
    displayName
    name (environment ID)
    environmentType
    3. Populate the Dropdown for Environments
    In your EnvironmentDropdown control:
    Powerfx-
    Items = PowerPlatformforAdmins.GetEnvironments().value
    Set:
    Powerfx-
    EnvironmentDropdown.DisplayFields = ["displayName"]
    EnvironmentDropdown.Value = "displayName"
  • Suggested answer
    deepakmehta13a Profile Picture
    304 on at

    Hi,

    To provide a list of available environments in your Power App, you can use the Power Platform for Admins connector. This allows you to pull the environment data into a simple list that your users can interact with.

    Here is exactly how to set it up:

    Step 1: Add the Connector

    In your Power App editor, go to the Data tab on the left:

    1. Click Add data.

    2. Search for "Power Platform for Admins" and select it.

    3. Ensure you are using an account with Power Platform Admin or Global Admin privileges.


    Step 2: Create the Collection

    To make the data easy to use in your UI, you need to extract the names from the connector's results. Paste this formula into the OnVisible property of your screen (or the OnStart of the App):

    Note: We use ForAll here to move the displayName out of the properties section so it is easy to select in your dropdown.


    Step 3: Configure the Dropdown

    Now that your data is ready, set up your control:

    1. Insert a Dropdown or Combo Box.

    2. Set the Items property to:

      colEnvironments

    3. In the right-hand Properties pane, set the Value (or DisplayField) to:

      EnvName


    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated

  • Suggested answer
    DP_Prabh Profile Picture
    341 on at

    Hi @luisafrancoj95,

    You can retrieve the list of all environments in Power Platform by using the Power Platform Admin connector. This can be done directly in Power Apps or Power Automate.

    First, add the Power Platform Admin connector as a data source in your app and establish the connection. This connector provides access to environment details and other admin-related information.

    To get the details of all environments, use:
    PowerPlatformforAdmins.GetAdminEnvironment().value

    This returns information such as id, name, type, properties, and location for each environment.

    In Power Apps, you can store the result in a collection and display it in a dropdown or gallery or any other preferred way.

    Example output:

    [
      {
        "id": "/providers/Microsoft.BusinessAppPlatform/environments/Default-12345678",
        "name": "Default-12345678",
        "type": "Microsoft.BusinessAppPlatform/environments",
        "location": "unitedstates",
        "properties": {
          "displayName": "Default Environment",
          "environmentType": "Default",
          "createdTime": "2023-08-01T10:30:00Z",
          "createdBy": {
            "displayName": "Admin User",
            "id": "user-id"
          }
        }
      }
    ]
    

    Commonly used fields:

    name → Environment ID

    properties.displayName → Environment name shown in Power Platform

     
     
     
     
     

    properties.environmentType → Environment type (Default / Sandbox / Production)

     
     

    location → Region

     

    .value returns an array of environment objects containing metadata for each environment.

    Reference: https://learn.microsoft.com/en-us/connectors/powerplatformforadmins/#list-environments-as-admin

    I hope this helps you!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard