cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

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
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,860)