Search code examples
powerappspowerapps-formula

how to show the dropdown values to be shown only once in the list using powerapp


I have a dropdown that shows me some categories and those categories in turn have a list of subcategories

The problem I am having is that certain categories appear repeated, and I would like to know how I can show the categories, not repeated

  • Category

enter image description here

Table1
  • Sub Category

enter image description here

Filter(Table1; CATEGORIES = CategoriesDropdown.SelectedText.CATEGORIES)

Solution

  • it seems you are after the Distinct funciton in Power Apps.

    Distinct(List/Table Name,ColumnName)
    

    Not enterily sure what field you are using to display data in your Category dropdown, but generally this is how you'd do it:

    Distinct(Table1, *Title) //use the column name you want to get the distict values
    

    You can also apply the same logic for the Second dropdown

    For further reference, this Microsoft article will give you all the details about the Distinct function.

    Note: Your List/Table could be:

    • A Collection
    • The Connection Name e.g. your SharePoint list or your SQL table
    • A filtered collection/table
     Distinct(Filter(Table1, CATEGORIES = CategoriesDropdown.SelectedText.CATEGORIES), ColumnName)
    

    Hope it helps