cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mikeMar2
Regular Visitor

Combobox Selection Removed

I have a combobox and a collection that stores name and email from the combobox selection. The combobox is inside a form and I need to have the ability to deselect items. I cannot think of a way to have the deselected items (names) be removed from the collection as well. 

 

The issue is with editing a form, not creating a new one. The screen where the form is has the OnVisible property set to:

Clear(nameColl);Clear(emailColl);

ForAll(Split(adminSelected.'Staff Attorney'," | "),Collect(nameColl,{name: Result,Index: CountRows(nameColl) + 1}));

ForAll(Split(adminSelected.'Staff Attorney Email',";"),Collect(emailColl,{email: Result,Index: CountRows(emailColl) + 1}));

ClearCollect(nameAndEmail,

    Collect(

        RenameColumns(

            AddColumns(

                nameColl,

                "Email",

                LookUp(emailColl,Index = nameColl[@Index],email)),

            "name","Name"),

        RenameColumns(

            Filter(emailColl,Not(Index in nameColl.Index)),"email","Email")

    )

)

image.png

This creates the collection that looks like this (which is exactly what I want):

image.png

 

Thanks in advance!

5 REPLIES 5
DylanSimons
Resolver III
Resolver III

Could you also put that exact formula in the "Onchange" property of the ComboBox? It might be too slow, but the collection would always have the same values as the ComboBox.

I don't have anything in the OnChange property, that is what I'm trying to figure out. The collection and comboxes are populated from the same record so they enter the screen with identical information.

 

I think I can manage if additional selections are added (or an additional selection is removed) but the thing that is tripping me up is removing a selection that is already there. 

Try and copy that whole formula into the OnChange property of the ComboBox. Keep the formula in the OnVisible property as well, just add this.

 

Whenever anyone adds or deletes a selection it will clear and fill the collections again.

It might just be on my end but I'm not seeing anything come up.

What is "adminSelected"? Is this a variable that is set somewhere?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (4,354)