cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ecflip29
Level: Powered On

How can I make it mandatory to select one of three buttons

Hello,

 

I am trying to ensure that when filling in a form the candidate selects one of the three status buttons before submitting.

 

I currently have a condition on the 'Submit' button that if a certain field is blank it will bring a pop-up saying invalid entry (which functions as desired, see below). So I want to add a condition for if none of the 'status' buttons are selected you can't submit, I have added the following code but this does not work.

 

If(IsBlank(DataCardValue26_1.Text),Navigate(Submit4ApprovalFail_NameMissing),SubmitForm(Form4_1));

 

If(Select(Button2)&&Select(Button3)&&Select(Button6)=false,Navigate(Submit4ApprovalFail_NoStatus),SubmitForm(Form4_1))

 

Any advise would be helpful, I can't seem to find much on line about if buttons are not selected.

Thanks,

 

 

2 REPLIES 2
Super User
Super User

Re: How can I make it mandatory to select one of three buttons

Since you are using buttons the easiest way to do this would be to add something like this to the OnStart method of the App

set(statusSet,false)

The add something to the OnSelect method of each button that sets the variable 

set(statusSet,true)

Then check the the value of StatusSet to enable or disable the Submit button for the form by adding the following to the DisplayMode property of the Submit button

If(statusSet,DisplayMode.Edit,DisplayMode.Disabled)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
emh
Level 8

Re: How can I make it mandatory to select one of three buttons

@Pstork1 Pstork1 made an excellent recommendation. You will also want to consider how you will reset your global variable. When the screen is re-displayed, the global status variable will need to be reset to false. When you have the initialization in the OnStart property, this initialization can only happen once as the OnStart commands are only executed one time, when the program begins. A good place to reset the global status variable to false is in the OnSelect property of the buttons.

 

It may also not be necessary to use a global variable. A context variable will work fine.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 41 members 3,978 guests
Please welcome our newest community members: