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??
Solved! Go to Solution.
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
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
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")
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.
Default Item property on Power apps shows like this.
I tried FirstN(***.TestList, 2) or Filter function but I had an error.