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

Defines required based in Checkboxes Gallery

I am building a simple form sender in PowerApps

i already figured out how to set required fields based in a single selection box, but im working with a Collection, and i want to define if my Card is visible and required if a value is there selected among others

 

Basically:

 

This field defines my collection values

Igarsaba_0-1638651333576.png

 

 

i want to show and require cards just with that values selected in my Collection

 

Igarsaba_1-1638651446302.png

Anyone can help?

 

1 REPLY 1
AmDev
Super User
Super User

Hi @Igarsaba 

 

Am I right in saying you want to either show or hide the fields depending on what category is selected in the check boxes?

 

You mentioned that the checkboxes are defining your collection - I assume by that you mean you have added code in the 'OnCheck' and 'OnUncheck' of each checkbox to either add or remove something from that collection?

 

If so, you can simply add an 'in' expression to the visibility property of the fields you want to hide, which would be something like this for the PPRA field:

"TextinCol_ForPPRA" in colYourCollection

 

 So when you check the checkbox, adding the value "TextinCol_ForPPRA" to your collection, the above expression resolves to true making it visible. When you uncheck PPRA, you remove "TextinCol_ForPPRA" from the collection, meaning the above resolves to false, hiding the field. And just apply this logic for all fields you want to show and hide.

 

Hope this helps and my understanding of your question is correct - Good Luck!☘

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

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