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

Required Field

Ignore this, i managed to solve it. 

 

I have a field in my PowerApp that becomes visible if 'Yes' is selected from a dropdown box.  If Yes is selected, i would like the now visible field to be a required field.

 

If no is selected, then the field doesn't require an answer.  Is there a formula i should add to the required option to make this possible?

 

I have made the field required but if 'No' is selected it wont let the user proceed.

 

thanks

Alistair

1 ACCEPTED SOLUTION

Accepted Solutions
Andy_Tuke
Level 8

Re: Required Field

Good to hear.

 

You might be able to simplify your code though.  Since the Required property is wanting a boolean, and the value of the checkbox is a blooean, you should find that you can set the required property to simply

 

DataCardValue12.Selected.Value (if its a checkbox) or at most

DataCardValue12.Selected.Value="Yes"

 

Andy

View solution in original post

3 REPLIES 3
Andy_Tuke
Level 8

Re: Required Field

I dont believe you can do it that way, but you can achieve the same thing by making the 'Enabled' mode of the Save/Proceed button for example based on the logic.

For the button set the property DisplayMode to something like

 

If (
   (chkOptional.Value && !IsBlank(txtInput)) || !chkOptional.Value, 
   DisplayMode.Edit, 
   DisplayMode.Disabled
)
neill_long
Level: Powered On

Re: Required Field

Hello @Andy_Tuke

 

It seemed to work for me when i added in the Required option - If(DataCardValue12.Selected.Value="Yes",true)

 

If i experience any problems with what i have done then i will certainly try what you have suggested.

 

thanks

Andy_Tuke
Level 8

Re: Required Field

Good to hear.

 

You might be able to simplify your code though.  Since the Required property is wanting a boolean, and the value of the checkbox is a blooean, you should find that you can set the required property to simply

 

DataCardValue12.Selected.Value (if its a checkbox) or at most

DataCardValue12.Selected.Value="Yes"

 

Andy

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,699)