cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sloughcow
Microsoft
Microsoft

Make an interface element aware of its presence in a collection

Hi there - I'm new to PowerApps and just learned about collections. I can see how to make an interface element like a checkbox cause an item to get added to what's effectively an array, and it's really easy to cause items to be added or removed to a collection - that's joyful!

 

I can't quite figure out how to make that checkbox aware that ThisItem was removed from a collection - I want it to listen for the item's status in a collection, and act when the status changes.

 

For example...

 

I have a checkbox that adds an item to a collection, and I have a button that removes an item from a collection. But I could have multiple screens with different user interactions, so...

  • The checkbox on screen 1 that adds the item to a collection works beautifully
  • The button on screen 2 that removes the item from the collection also works beautifully
  • ...but if a user adds ThisItem to the collection on screen 1 and removes ThisItem from the collection on screen 2, and navigates back to screen 1... the checkbox remains checked. I would like the checkbox to listen for ThisItem's addition or removal from that collection, and change its state as a result. 

It's possible, right? I'll appreciate advice!

1 ACCEPTED SOLUTION

Accepted Solutions
AmDev
Super User
Super User

Hi @sloughcow 

 

Set the Default property of your checkbox to:

 

ThisItem in YourCollectionName

 

Hope this helps

 

View solution in original post

2 REPLIES 2
AmDev
Super User
Super User

Hi @sloughcow 

 

Set the Default property of your checkbox to:

 

ThisItem in YourCollectionName

 

Hope this helps

 

sloughcow
Microsoft
Microsoft

Thank you @AmDev !

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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
Users online (1,107)