Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

A choice from multi-select check-boxes need to be Required before submission

(0) ShareShare
ReportReport
Posted on by 5

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,

  • AndreaFC22 Profile Picture
    AndreaFC22 5 on at
    Re: A choice from multi-select check-boxes need to be Required before submission

    Thank you, @WarrenBelz! Appreciate the help.

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,567 on at
    Re: A choice from multi-select check-boxes need to be Required before submission

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard