cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LongRider971
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
v-xida-msft
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
Edwin-Abdalian
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!

v-xida-msft
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

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.

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

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.

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.

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

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,256)