cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MQN
Helper I
Helper I

How to perserve checkbox control through search?

Hello,

 

I'm trying to write a simple app to help with item requests. The idea is that I populate a sharepoint list with the items and the departments/roles, and users can search for their roles, mark the items that they need, and submit them. I'm displaying the items on the cards in a gallery, and filtering the gallery with textbox.text in roles to make it easier for users to search up their specific items. I've added a checkbox control, but the checkbox isn't tied to any field in the list(because the expectation is that everyone would use the same master list, so I can't just have a boolean field to mark whether or not it's been requested).

 

appsnip.PNG

 

However, when items are filtered out by the search and the search is changed to bring back the items, the item comes back unchecked. This means that I can't simply collect the items on check and remove them on uncheck, because they aren't necessarily paired. This also means that it's possible to re-check the same item multiple times, adding the item multiple times, and making it... unpleasant to read through when it comes in at the end. 

 

Is there a way to preserve the checked status of the checkbox through filtering? 

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi @MQN,

 

The filter or search function works direclty at the data source side, if you would like the filter to work with the selected item, then there should be a field to mark the selected status.

For the checkbox status, as you didn't specify the data field for it, there is no way to preserve the checked status.

If adding a boolean field is not possible, then please consider add a text field, then update this field with the corresponding user name if he/she has selected the item.

Then modify the Gallery items property, filter out the text field with no values. for another selection.

For the checkbox status, use the if condition to specify its corresponding value, based on the Text field value.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-micsh-msft
Community Support
Community Support

Hi @MQN,

 

The filter or search function works direclty at the data source side, if you would like the filter to work with the selected item, then there should be a field to mark the selected status.

For the checkbox status, as you didn't specify the data field for it, there is no way to preserve the checked status.

If adding a boolean field is not possible, then please consider add a text field, then update this field with the corresponding user name if he/she has selected the item.

Then modify the Gallery items property, filter out the text field with no values. for another selection.

For the checkbox status, use the if condition to specify its corresponding value, based on the Text field value.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks! 

 

I don't want to allow the text field to grow beyond an individual run of the app. Is there a way to loop through all the items and clear this text item? I figure I'll do that when the application closes, because I don't want this user to open the app again later and still see their prior selections. 

Whoops, double post. orz.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (40,716)