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

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

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
Resolver IV
Resolver IV

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
)

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,172)