Hello,
Need some expert help!
My Data-card “Check Your Choices” (screenshot below) has a Gallery with Multi-select check-boxes - I need this data card to be a mandatory/required field when, if no check-boxes are checked, the Submit button will not be live.
The Submit button also includes expressions for the text fields - Text Field 1 and Text Field 2 - and they behave as expected for “Required” text fields.
Here is what I have on my Submit button DisplayMode:
"If(
!IsBlank(crdTextField1.Text) &&
!IsBlank(crdTextField2.Text) &&
!IsBlank(crdCheckChoices.Update),
DisplayMode.Edit, DisplayMode.Disabled)"
If I missed filling either of the text fields, the Submit button remains unavailable.
If, on the other hand, I fill out the Text fields but skip the Choices check-boxes, the Submit button becomes available, even though it shouldn’t since a choice was not made.
Required property for the Data card is selected . Default and Update set to a collection.
On the gallery I have Items set to Choices([]) , OnSelect to false and Selectable to true.
On the checkbox control, I have a collection in OnCheck-Collect/OnUncheck-Remove,
OnSelect I have Select(Parent), Text I have ThisItem.Value.
I tried to do a CountRows for the gallery and it only shows 0 whether I have boxes checked or not so my expectation is that something is weird with my gallery/multi-choice check boxes
Text fields work as expected.
Any other ideas of how I could get this right? Appreciate your time.
Thanks,
Thank you, @WarrenBelz! Appreciate the help.
Hi @AndreaFC22 ,
Without going into any other logic required, for what you have posted, I think you need this
If(
!IsBlank(crdTextField1.Text) &&
!IsBlank(crdTextField2.Text) &&
CountRows(
Filter(
GalleryName.AllItems,
CheckBoxName.Value
)
) > 0,
DisplayMode.Edit,
DisplayMode.Disabled
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps