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 / Filter items in dropdo...
Power Apps
Answered

Filter items in dropdown list from sharepoint

(0) ShareShare
ReportReport
Posted on by 23

I want to filter drop-down list items are referenced by share point.

Specifically, there is are items in share point list like this ["A", "B", "C", "D", "E"].
Then in App1, I want to get top 2 items ["A", "B"] from a list, and App2 wants to get until third lower place ["C", "D", "E"].

 

I used FirstN and LastN property, but it didn`t get a result.

Are there any way to solve this problem??

Categories:
I have the same question (0)
  • Andy_Tuke Profile Picture
    141 on at

    Hi,

     

    FirstN (and LastN) should work fine.  I assume you are trying to filter a Gallery to only show the required items from the SharePoint list?

     

    I have created a list in SharePoint and added 5 items where the title is set to A,B,C,D,E

    I created a blank app and add a datasource to that list

    I inserted a gallery, linked to that datasource with 1 fields showing which I set to the Title column of the SharePoint list.  My gallery now shows all the items in the list

    To filter to the first 2 items I set the Items parameter of the Gallery to FirstN(DemoList,2)

     

    At this point, the gallery goes blank.  This is because when you change parameters on the gallery it resets the column that it is showing to the default, and useless ComplianceAssetId which is a built in SharePoint list column.  You can set it back in the gallery Data panel to Title again to fix it.  You will find that if you keep editing the gallery you will need to fix it again.  To stop this behaviour so it stays on the column you want change the Text parameter of the label in the gallery from ThisItem.Title to Title

     

    Hope that helps, let me know if it doesnt.  I sense English isn't your first language and I might have misunderstood your issue

    Andy

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Collonville,

     

    can you provide your function and a screenshot of your Sharepoint list? How do you receive your data?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Are you sure the gallery isnt resetting the controls for the selected items back to something like ThisItem.ComplianceAssetId when you change the items parameter?  For some reason, whenever you change properties of a gallery it does this, the simplest fix is to remove the ThisItem prefix once you've chosen the column you want to display

  • SanchezITM Profile Picture
    153 on at

    Try this

     

    Sharepoint list name= List1

    Column name= Column1

     

    Column1 "Items" = One, Two, Three, Four, Five

     

    App1 -Dropdown1 Items = Filter(List1;Column1="One" || Column1="Two")

     

    App2 -Dropdown2 Items = Filter(List1;Column1="Three" || Column1="Four" || Column1="Five")

     

  • Collonville Profile Picture
    23 on at

    @SanchezCSG @Anonymous @Anonymous @Andy_Tuke

    Thanks for your reply.

    The list data what I`m assuming is the choice option of Share point like left figure(Sorry for the Japanese language).
    Then, I want to show only ["A", B"] choice in App1, ["C", "D", "E"] choice in App2 list using a drop down on the edit form. Usually, it will show drop down list like right figure. So I want to display separately while referring to the same share point.

    SharepointList.JPG

     

     

     

     

     

    SharepointList2.JPG

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Default Item property on  Power apps shows like this.SharepointList3.JPG

     

     

    I tried FirstN(***.TestList, 2) or Filter function but I had an error. 

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Collonville,

     

    use the FirstN function this way:

    FirstN(Choices('your_list.Testlist'), 5)

    I guess this will only be possible in a form which generates the fields.

     

     

  • Collonville Profile Picture
    23 on at

    Thank you!! It worked well.

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 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard