cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Manc_Gurl
Resolver I
Resolver I

Button Display Mode and Required Fields and Attachments

I'm trying to disable a button unless all required fields have been filled in, I had this working fine until I needed to add an attachments datacard on my form.  Ultimately what I need to do it make sure that if the user selects "yes" in my radio selection for secure access that the submit button remains disabled until they've uploaded at least one attachment. 

 

My form has a radio button asking the user if they need to add multiple users, if they select No only the fields that are required for a single user need to be filled in before the button is active. If they select yes then they are given a datatable to populate and add multiple users.  This works fine but now that I have the attachments datacard, I need to somehow check to see if they selected Yes for rad_secureaccessrequired (for a single user) or radSecureAccessRequired for the multiple users.  I can't get this to work.  

 

Below is the working code I have which excludes checking the attachments and radio buttons for secure access. I've tried lots of ways to add in the check for secure access and attachments none of which have worked.

 

If(
rad_MultipleVisitors.Selected.Value = "Yes" And CountRows(colVisitors) > 0 And ico_RequestorName.Icon = Icon.CheckBadge And ico_RequestorPhone.Icon = Icon.CheckBadge And ico_ReasonForVisit.Icon = Icon.CheckBadge And ico_EscortName.Icon = Icon.CheckBadge And ico_StartDate.Icon = Icon.CheckBadge And ico_EndDate.Icon = Icon.CheckBadge And ico_MultiVisitors.Icon = Icon.CheckBadge,
DisplayMode.Edit,
rad_MultipleVisitors.Selected.Value = "No" And ico_RequestorName.Icon = Icon.CheckBadge And ico_RequestorPhone.Icon = Icon.CheckBadge And ico_ReasonForVisit.Icon = Icon.CheckBadge And ico_EscortName.Icon = Icon.CheckBadge And ico_StartDate.Icon = Icon.CheckBadge And ico_EndDate.Icon = Icon.CheckBadge And ico_SingleVisitorName.Icon = Icon.CheckBadge And ico_SingleVisitorEmail.Icon = Icon.CheckBadge And ico_SingleVisitorPhone.Icon = Icon.CheckBadge And ico_SingleVisitorUKNational.Icon = Icon.CheckBadge And ico_SingleVisitorNationality.Icon = Icon.CheckBadge And ico_SingleVisitorAccessLevel.Icon = Icon.CheckBadge And ico_SingleVisitorAccessAreas.Icon = Icon.CheckBadge And ico_SingleVisitorOrg.Icon = Icon.CheckBadge,
DisplayMode.Edit,
DisplayMode.Disabled
)

1 ACCEPTED SOLUTION

Accepted Solutions
Manc_Gurl
Resolver I
Resolver I

I have finally managed to resolve this myself after much trial and error.  I amended the code to below and it all works as expected.  Because I have a data table where visitors can be added and secure access specified for some of those visitors I needed to do a count in the displaymode property of my button.

 

If(
rad_MultipleVisitors.Selected.Value = "Yes" And CountRows(colVisitors) > 0 And ico_RequestorName.Icon = Icon.CheckBadge And ico_RequestorPhone.Icon = Icon.CheckBadge And ico_ReasonForVisit.Icon = Icon.CheckBadge And ico_EscortName.Icon = Icon.CheckBadge And ico_StartDate.Icon = Icon.CheckBadge And ico_EndDate.Icon = Icon.CheckBadge And ico_MultiVisitors.Icon = Icon.CheckBadge And CountRows(Filter(colVisitors,SecureAreaAccess = "Yes"))=0 Or CountRows(
Filter(
colVisitors,
SecureAreaAccess = "Yes"
)
) > 0 And CountRows(DataCardValue1.Attachments) > 0,
DisplayMode.Edit,
rad_MultipleVisitors.Selected.Value = "No" And ico_RequestorName.Icon = Icon.CheckBadge And ico_RequestorPhone.Icon = Icon.CheckBadge And ico_ReasonForVisit.Icon = Icon.CheckBadge And ico_EscortName.Icon = Icon.CheckBadge And ico_StartDate.Icon = Icon.CheckBadge And ico_EndDate.Icon = Icon.CheckBadge And ico_SingleVisitorName.Icon = Icon.CheckBadge And ico_SingleVisitorEmail.Icon = Icon.CheckBadge And ico_SingleVisitorPhone.Icon = Icon.CheckBadge And ico_SingleVisitorUKNational.Icon = Icon.CheckBadge And ico_SingleVisitorNationality.Icon = Icon.CheckBadge And ico_SingleVisitorAccessLevel.Icon = Icon.CheckBadge And ico_SingleVisitorAccessAreas.Icon = Icon.CheckBadge And ico_SingleVisitorOrg.Icon = Icon.CheckBadge And rad_SingleVisitorSecureAccessRequired.Selected.Value = "No" Or rad_SingleVisitorSecureAccessRequired.Selected.Value = "Yes" And CountRows(DataCardValue1.Attachments) > 0,
DisplayMode.Edit,
DisplayMode.Disabled
)

View solution in original post

1 REPLY 1
Manc_Gurl
Resolver I
Resolver I

I have finally managed to resolve this myself after much trial and error.  I amended the code to below and it all works as expected.  Because I have a data table where visitors can be added and secure access specified for some of those visitors I needed to do a count in the displaymode property of my button.

 

If(
rad_MultipleVisitors.Selected.Value = "Yes" And CountRows(colVisitors) > 0 And ico_RequestorName.Icon = Icon.CheckBadge And ico_RequestorPhone.Icon = Icon.CheckBadge And ico_ReasonForVisit.Icon = Icon.CheckBadge And ico_EscortName.Icon = Icon.CheckBadge And ico_StartDate.Icon = Icon.CheckBadge And ico_EndDate.Icon = Icon.CheckBadge And ico_MultiVisitors.Icon = Icon.CheckBadge And CountRows(Filter(colVisitors,SecureAreaAccess = "Yes"))=0 Or CountRows(
Filter(
colVisitors,
SecureAreaAccess = "Yes"
)
) > 0 And CountRows(DataCardValue1.Attachments) > 0,
DisplayMode.Edit,
rad_MultipleVisitors.Selected.Value = "No" And ico_RequestorName.Icon = Icon.CheckBadge And ico_RequestorPhone.Icon = Icon.CheckBadge And ico_ReasonForVisit.Icon = Icon.CheckBadge And ico_EscortName.Icon = Icon.CheckBadge And ico_StartDate.Icon = Icon.CheckBadge And ico_EndDate.Icon = Icon.CheckBadge And ico_SingleVisitorName.Icon = Icon.CheckBadge And ico_SingleVisitorEmail.Icon = Icon.CheckBadge And ico_SingleVisitorPhone.Icon = Icon.CheckBadge And ico_SingleVisitorUKNational.Icon = Icon.CheckBadge And ico_SingleVisitorNationality.Icon = Icon.CheckBadge And ico_SingleVisitorAccessLevel.Icon = Icon.CheckBadge And ico_SingleVisitorAccessAreas.Icon = Icon.CheckBadge And ico_SingleVisitorOrg.Icon = Icon.CheckBadge And rad_SingleVisitorSecureAccessRequired.Selected.Value = "No" Or rad_SingleVisitorSecureAccessRequired.Selected.Value = "Yes" And CountRows(DataCardValue1.Attachments) > 0,
DisplayMode.Edit,
DisplayMode.Disabled
)

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,174)