web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Remove Item from Choic...
Power Apps
Unanswered

Remove Item from Choices in ComboBox List Once Chosen

(2) ShareShare
ReportReport
Posted on by 5,325 Super User 2025 Season 2
I have Gallery1, in which is ComboBox1.

ComboBox1 is populated from an SP List using the following formula.
Filter(Activities_Collection,Title =
JS_Location_Dropdown.Selected.Project_Name,
Billing_Unit_and_Description)

I won't to restrict the ability of the user to select an Activity more than once - essentially,
remove the item from the ComboBox list once it has been selected.

I am doing a similar thing with a ComboBox regarding some images using the following -
 
  Filter(col_Drop_Job_Picture_Title_Collection,
        Not(
            Image_Name in Drop_Job_Image_Collection.DisplayName
  )
  )

How can I update my Activities ComboBox1 formula to achieve the
same function?

Categories:
I have the same question (0)
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
     Hi,
    Not quite sure if I understand you correctly,
    I have some test data ,
    onStart
    
    ClearCollect(
      TestValues,
      { Value: "1" },
      { Value: "2" },
      { Value: "3" }
    );
    
    Clear(colPicked);
    
    
    Combox1, Item = 
    Filter(
      TestValues,
      !( Value in colPicked.Value )
    )
     
    Combox1, OnChange=
    // save currently selected 
    ClearCollect(
      colPicked,
      Combox1.SelectedItems
    )
    ComboBox1.SelectMultiple = true.
     
     
  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at
    Yes, I believe you understand my intent.

    The ComboBox is in a Gallery.

    The user has the ability to create as many Activities in the gallery as necessary.

    The user should not be able to choose an Activity from the ComboBox more than once.

    Once the user selects and item from the ComboBox List (Activities_Collection) that item
    should be removed from the ComboBox list (though not deleted from the data source),
    and the ComboBox list refreshed to show all remaining items.

    There are more than 1.000 item in the list/collections, so itemizing as shown in your
    recommendation is not feasible. Is there another way to access the list of items.

    The ComboBox is currently accessing all the items through the Activities_Collection.

  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
     Hi,
    My example only used one control. 
    Your example is actually  two controls ( it's kind of two combox controls exchange the data dynamically).
     
    Filter(col_Drop_Job_Picture_Title_Collection,
            Not(
                Image_Name in Drop_Job_Image_Collection.DisplayName
      )
      )
     
    The screenshot from you, on the bottom , is that the combox you mentioned or it is another which gets the data from a combox( data source = Activities_Collection) ?
     
    is this similar like your gallery ( I will call it as a control column) ?
    and the selection will feed another control ( selected activities) ?
    if the end user cancels selected ones, then those return back to the combox list ?
    I assume this is only for user session, but for shared session ?
     
  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at
    You can disregard this...
     
      Filter(col_Drop_Job_Picture_Title_Collection,
            Not(
                Image_Name in Drop_Job_Image_Collection.DisplayName
      )
      )

    I was using it as an example of where it is working elsewhere in
    my app. But I don't think it will work here.

    I am fairly sure I have over-complicated things, and this rambling probably
    won't make it any easier, but here it goes...


    My goal is to prevent the user from being able select an item in a
    ComboBox more than once.

    Once an item is selected it should be removed from the ComboBox list.

    The source data is hundreds of items, so using something like -
    ClearCollect(
       TestValues,
       { Value: "1" },
       { Value: "2" }...


    ...at 'OnStart' on screen 'OnVisible' is problematic.


    Is there no way for the formula above to refer to an entire column
    in a collection, rather than itemizing each value?

    If no, I came up with a second option; a warning notification pop-up.
    However, I can't get the language right.

    The ComboBox 'OnChange' has -
    If(!IsBlank(Activity_Description_Fld.Text),
        Collect(colActivityComboBoxList, {ActivityName: Activity_Description_Fld.Text,
                                          Activity_intID: Activity_Gallery_intActivityID_Fld.Text}))

    The colActivityComboBoxList collection shows the data from the ComboBox 'OnChange'.


    However, the warning notification is nested inside the Gallery and the Gallery has no reference to the
    ActivityName (which is the key), as I'm not trying to limit the number of Activities that can be created,
    only that an Activity type cannot be used twice.

    Collect(
       colActivities,
       {
          intActivitiesID: GUID(),
          rem: false
       }
    );


     
    The best I can get so far is the count of item in the colActivityComboBoxList

    If
    (CountRows(colActivityComboBoxList) >1, true)

     
  • Verified answer
    stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
     Hi,
     
    I will explain another example ( similar to my first one).
     
    1.  I have a purchase order List in SharePoint, I will use Purchase Order Number to feed the combox1.
    2.  OnStart:
    ClearCollect(
        MyPO,
        RenameColumns(
            ShowColumns(
                FirstN(
                    Sort(
                        PurchaseList, //My List in SPO
                        ID,
                        SortOrder.Ascending
                    ),
                    1100 //Fetch out 1100 records.
                ),
                Title //I only need this column
            ),
            Title, // rename Title to POnumber.
            PONumber
        )
    );
    Clear(colPicked); //clear ComboBox1.SelectedItems) in colPicked.
    
    3. Combox1 .
    • OnChange =  ClearCollect(colPicked,ComboBox1.SelectedItems)
    • Items = Filter(MyPO,!(PONumber in colPicked.PONumber))
    4. Optional, if you don't want show a long list, use below for Items.
    With(
      {
        // if the user has typed, do a Search()
        // otherwise, show the first 5 POs
        baseSet:
          If(
            Len( ComboBox1.SearchText ) > 0,
            Search( MyPO, ComboBox1.SearchText, PONumber ),
            FirstN(
              Sort( MyPO, PONumber, SortOrder.Ascending ),
              5
            )
          )
      },
      // now hide any they’ve already picked
      Filter(
        baseSet,
        Not( PONumber in colPicked.PONumber )
      )
    )
     
    hope this give you a lead.
  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at
    I'm working through it.

    This is close. 
     
    I have more than one column in my colPicked collection (even though only one has content).
    My version shows the renamed column with appropriate content. However, it is also bringing
    in ALL columns from the list.

    Shouldn't I only have one column in the colPicked collection?





    'OnStart' has the following. What am I missing?
     
    ClearCollect(
        Activities_Collection,
        RenameColumns(
            ShowColumns(
                FirstN(
                    Sort(
                        Activities_List,
                        ID,
                        SortOrder.Ascending
                    ),
                    1100
                ),
                Billing_Unit_and_Description
    ),
    Billing_Unit_and_Description,
    ActivityRemaining
    )
    );
     
    Clear(colPicked);
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    It might come from your cache or something, since Activities_Collection only has one column, colPicked should have one column as well...
     
     
  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at
    Got it working, except it is showing ALL remaining items from the SP List/Collection.
     
    The original formula filtered by Location (see below).
     
    How do I incorporate the following into the ComboBox items so that the return is ONLY specific to the Location (chosen elsewhere)?
     
    Filter(Activities_Collection,Title =
    JS_Location_Dropdown.Selected.Project_Name,
    Billing_Unit_and_Description)
  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at
    @stampcoin

    Actually, I think I wrote something wrong in the 'OnStart'.

    I have this at the top of 'OnStart', which use to populate ALL columns of the Activities_Collection
    with data.


    This is what the Activities_Collection looks like now, with the original formula at the top of 'OnStart'
    and the new (my version of your suggestion) formula at the bottom.

    I think I should probably rename the collection in my version of your formula so that it contains only
    one column and doesn't impact my original Activities_Collection, maybe?
    ClearCollect(
        Activities_Collection,
        RenameColumns(
            ShowColumns(
                FirstN(
                    Sort(
                        Activities_List,
                        ID,
                        SortOrder.Ascending
                    ),
                    1100
                ),
                Billing_Unit_and_Description
    ),
    Billing_Unit_and_Description,
    ActivityRemaining
    )
    );
     
    Clear(colPicked);



    Also, did you have any recommendation on how to filter your version by Location, with something like the following?
    Filter(Activities_Collection,Title =
    JS_Location_Dropdown.Selected.Project_Name,
    Billing_Unit_and_Description)
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    When you say 'Location',  is it the default type one, or your customized one (single line text) ?
    default location type is kind of a table....

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard