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 a choice list i...
Power Apps
Answered

Filter a choice list items based on a if condition on another column in the same list

(1) ShareShare
ReportReport
Posted on by 25

Hi, I am new to power app.
I have a SharePoint list which two choice columns (one column name is "Product teams" (let's say choices are A, B, C, D) and another column name is "Archive?" (let's say choices are Yes and No).

Product Teams (Choice)Archive? (Choice)
ANo
BYes
BNo
CNo

If my "Archive?" column choice is "Yes" at least once for a particular product team, then that corresponding product team item (ie B here) will fall off from "Product team" choice list. (ie, B will not be shown as a choice to the user in the user form).

 

What should be the formula and where should I put it?  

Categories:
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @kundup,

     

    If both columns are choice columns (without multi selection), you could filter the list by Archive = Yes and then only display the Product Teams choices that are not in this filtered list. Adjust the code to your specific case where necessary (list name & column names):

     

    With(
     {
     //Temp store all unique product teams with the archive value 'Yes'
     choiceValYes: Distinct(
     Filter(
     LISTNAME,
     Archive.Value = "Yes"
     ),
     'Product Teams'.Value
     )
     },
     //Only display the choice options not contained in that filtered list
     Filter(
     Choices(LISTNAME.'Product Teams'),
     !(Value in choiceValYes)
     )
    )

     

    The code above could be used in the Items property of a dropdown.

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • kundup Profile Picture
    25 on at

    Hey, where should I put this code? Or which property should I update in power app? Archive column is not visible to the user in the form but product team is a datacard.

  • LaurensM Profile Picture
    12,516 Moderator on at

    @kundup,

     

    You will have to put this code in the Items property of the Product Teams' DataCardValue (the dropdown where you only want to see the 'No' product teams). You might have to unlock the datacard first by clicking on that particular card, navigating to the property panel on the right, 'advanced' and select unlock datacard.

     

    I hope this helps!

  • kundup Profile Picture
    25 on at

    This is awesome! Thank you so much.

  • kundup Profile Picture
    25 on at

    Hey @LaurensM , I am facing another issue: 

     

    I have this below formula in "Update" Property of 'Product Teams_Data Card' which allows me to enter the choices manually and if its not in the list, it will add to the dropdown list. But after applying the above code, that has stopped working- I am not able to enter the values manually. 

     

    If(
    IsBlank(DataCardValue11.Selected),
    {Value: DataCardValue11.SearchText},
    DataCardValue11.Selected
    )

     

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi,

     

    I tested this on my end and I could still add new choice options by typing them out manually and submitting the form. Normally this functionality should still work, since the datasource for that dropdown is still the Choices(LISTNAME.'Product Team') as it was before - just filtered this time:

     

    LaurensM_0-1678544390422.png

     

    Are you receiving an error when trying to add a new choice type? Keep in mind, if Archive is 'Yes' by default. These options will not show in the list because we filter them out.

  • kundup Profile Picture
    25 on at

    The default value of Archive is "No". Its giving me no option to type..I have the 'allow manual entry' check box ticked in SharePoint column for Product team. Its directly giving me the drop-down value to choose.

     

     

     

     

     

  • LaurensM Profile Picture
    12,516 Moderator on at

    This might be because the isSearchable property of the dropdown is set to false. Could you select the DataCardValue and double check the IsSearchable property? This should be set to true.

  • kundup Profile Picture
    25 on at

    This works now. Thanks a lot.

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 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard