Showing results for 
Search instead for 
Did you mean: 
Advocate V
Advocate V

Method to Remove items from local Collection

I have an app with various medical questions that I want to flag and collect a condition everytime the user selects "Yes".  Here is an example of my code behind a toggle button:  If(ynSmoker.Value,Set(ReviewFlag,true);Collect(ReviewItems,"Smoker"),false)


So my question would be, what if that user selects Yes, but then reverts back to No?  I need to Remove that item from the collection.  Would it be as simple as "Remove(ReviewItems,"Smoker")?  I dont think it would be that easy I am guessing






And your guidance did work.  I tested it and looked at the Collection data in the IDE and I used this: If(ynSmoker.Value,Collect(ReviewItems,"Smoker"),Remove(ReviewItems,First( Filter( ReviewItems, Value="Smoker" ) ),All ))


I really didnt need a column name as it is set to "Value" automatically and for me right now, that is all good.


Thanks again!

Community Champion
Community Champion

Awesome! Nice work.

Helpful resources

PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.


Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,690)