cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

PowerApp Form field Validation/Formatting

I am a rookie at PowerApps and i am sure this question is beyond simple for most people....

 

I have a form with several fields, two of which are 'Status' (Dropdown - Approved, Denied, In Progress) and 'Denied Reason' (Multiple Line of Text). 

 

What i am trying to do involves two stages:

1. 'Denied Reason' is only visible if the Denied 'Status' is chosen 

2. If Denied is chosen, 'Denied Reason' is a required field

 

I have been messing with this for hours and i cannot seem to figure out how to accomplish either of these.  If someone can lend a hand, it will have a major impact as learning these two steps will easily evolve into much more.  I have worked extensively with InfoPath and Nintex, now i just need to learn PowerApp forms. 

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @LongRider971 ,

Based on the needs that you mentioned, I think the If function could achieve your needs. I have made a test on my side, please take  a try with the following workaround:

Set the Visible property fo the 'Denied Reason' data card in your Edit form to following:

If(
   StatusDropdown.Selected.Value = "Denied",
true,
false )

Set the Required property of the 'Denied Reason' data card in your Edit form to following:

if(
    StatusDropdown.Selected.Value = "Denied",
    true,
    false
)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Highlighted
Solution Supplier
Solution Supplier

First thing you need to make sure is that your Status dropdown has an empty "" value. if it doesn't have then you either add it to your datasource or you use a collection in Start of your App: ClearCollect(colStatus, ""); Collect(colStatus, YourDataSource)

 

For now, I created a dropdown that has these values items.PNG

and I have a form that has only 2 data cards.datacard-1.PNG

you just need to work with drpStatus.Selected.Status to construct your logic

1- on Visible of the Reason_DataCard1 : If(drpStatus.Selected.Status <> "",true,false)

2- on Required of the Reason_DataCard1 : If(drpStatus.Selected.Status = "Denied",true,false) (you need to unlock the advanced properties of this control in order to be able to modify it)3.PNG

 

--------------------------------------------------------------------

Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

Highlighted
Community Support
Community Support

Hi @LongRider971 ,

Based on the needs that you mentioned, I think the If function could achieve your needs. I have made a test on my side, please take  a try with the following workaround:

Set the Visible property fo the 'Denied Reason' data card in your Edit form to following:

If(
   StatusDropdown.Selected.Value = "Denied",
true,
false )

Set the Required property of the 'Denied Reason' data card in your Edit form to following:

if(
    StatusDropdown.Selected.Value = "Denied",
    true,
    false
)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted

Thank you.  I have been out since shortly after posting this.  I'll give this method a shot today and will respond then.  Thanks in advance.

Highlighted

Thank you. I will give this a shot sometime today and will respond with my results. I appreciate it.

Highlighted

Hi @LongRider971 ,

Have you solved your problem with the solution I provided above?

 

Please take a try with the solution I provided above, then check if the issue is solved. If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Sorry for the delay.

 

This Required method did not work for me.  After the form is saved, the field is required but it does not work in real-time.  For instance, i can select any status and the field is not required until it is saved and then re-opened.  I think this has to do with 'Selected'.  When i have the formula with Selected, i get an error and it only works if i remove Selected.

Highlighted

OMG.... i figured it out.  I do not want to admit what i was doing wrong though hahaha.  Thanks a bunch.

 

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 (8,908)