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 / Dropdown list based on...
Power Apps
Answered

Dropdown list based on Sharepoint list Items

(0) ShareShare
ReportReport
Posted on by 204

Hi ,

 

I want to assign drop down items to a drop down list from a SharePoint list, I have used following to split the site column as in SharePoint list the data stored as a single string separated by a comma.

es Sharepoint list site column- > Site1,Site2,Site3

I want to display in dropdown ->Site1

                                                     Site2

                                                     Site3

I m checking the current logged in user and get the relevant sites, Only one item will have in Sharepoint list for one particular user .

I have done the follwing but, ?Im getting the empty display on dropdown. 


Distinct(DriverRegistrationList,TrimEnds(Split((LookUp(DriverRegistrationList,Email=User().Email,Sites)),",")))

site1.png

But when i do this I can see the sites as a one string 

Distinct(DriverRegistrationList,LookUp(DriverRegistrationList,Email=User().Email,Sites))

site.png

 

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @NewNW 

    I am not clear on if there will be multiple items in the list that will match the criteria and if you want all of those to appear in the dropdown.  So, I will propose two solutions for you.

     

    Solution 1 - The SharePoint list will only have one record that will satisfy the condition Email=User().Email

    This is relatively straight-forward. You get one result back from the list and you want to split the column called Sites and display in the dropdown list.

    Your formula for your Items Property on your DropDown control will be this:

    Distinct(
    TrimEnds(
    Split(
    LookUp(DriverRegistrationList,Email=User().Email).Sites,
    ",")
    )
    )

    I'm not entirely sure that you need the Distinct function here, but since you mentioned it, I will assume that the resultant split of Site names could possibly contain duplicate information.

     

     

    Solution 2 - The SharePoint list will have multiple records that will satisfy the condition Email=User().Email

    This is slightly trickier as you need to employ the use of a Collection to "pre-build" your list.

     

    In this solution we need to put a formula somewhere (like OnVisible of the Screen, or someplace where we need the values in the list to change).

    That formula would be the following:

    Clear(colSiteList);
    ForAll(
     Filter(DriverRegistrationList, Email=User().Email), 
     Collect(colSiteList, 
     TrimEnds(
     Split(Sites,",")
     )
     )
     )

    The Items Property on your DropDown control would be this:

       Distinct(colSiteList, Result)

     

     

    I hope this is helpful for you and is what you are looking for.

     

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @NewNW ,

    Could you please share a bit more about the Email column in your SP list? Is it a Single line text type column?

    Could you please show more details about the DriverRegistrationList that you mentioned? Is it the SP list data source within your app?

     

    I assume that the Email column is a Single line text type column in your SP list, based on the formula that you provided, I think there is something wrong with it.

    I also found that you have submitted similar issue within this forum, please check my response within the following thread:

    https://powerusers.microsoft.com/t5/General-Discussion/Adding-drop-down-items-based-on-the-login-user-Items-in/m-p/276749#M80599

     

    Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

    Set the Items property of the ComboBox to following formula:

    Split(
    TrimEnds(LookUp(DriverRegistrationList, Email=User().Email, Sites)),
    ","
    )

     

    If the Email column is a Person column in your SP list, please take a try with the following workaround:

    Set the OnStart property of the App control or OnVisible property of the first screen of your app to following:

    ClearCollect(RecordsCollection, DriverRegistrationList)

    Set the Items property of the Site ComboBox to following:

    Split(
     TrimEnds(LookUp(RecordsCollection, Email.Email = User().Email, Sites)),
     ","
    )

    Please take a try with above solution I provided, check if the issue is solved. If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

     

    Best regards,

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 Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard