cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
LongRider971
Level: Power Up

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
Community Support Team
Community Support Team

Re: PowerApp Form field Validation/Formatting

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
Edwin-Abdalian
Level 10

Re: PowerApp Form field Validation/Formatting

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!

Community Support Team
Community Support Team

Re: PowerApp Form field Validation/Formatting

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

LongRider971
Level: Power Up

Re: PowerApp Form field Validation/Formatting

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.

LongRider971
Level: Power Up

Re: PowerApp Form field Validation/Formatting

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

Community Support Team
Community Support Team

Re: PowerApp Form field Validation/Formatting

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.
LongRider971
Level: Power Up

Re: PowerApp Form field Validation/Formatting

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.

LongRider971
Level: Power Up

Re: PowerApp Form field Validation/Formatting

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

 

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
Users Online
Currently online: 162 members 6,058 guests
Please welcome our newest community members: