cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gorilla_8
Super User
Super User

Highlight mandatory fields in the powerapps if you are looking for white or empty

Hello guys!

 

I have several forms that have mandatory and visible fields depending on other fields, what I want to do is:

 

Would it be possible, when saving the form, that the fields that are mandatory and not filled in are highlighted for the user?

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Gorilla_8 

 

In that case, you can setup the configuration as:

 

RequiredControls -> Border Color -> If(varHighlight && IsBlank(ControlName.Text), RGBA(highlightcolor),RGBA(normal color))

 

Save Button ->  If(IsBlank(Control1.Text) || IsBlank(Control2.Text) || IsBlank(Control3.Selected.Value), Set(varHighlight,true), Set(varHighlight,false)) ;If(varHighlight=false, SubmitForm(FormName)) 

 

Here, we are checking whether all the required fields are filled, it they are we are setting varHighlight  as false, and submitting the form, otherwise we are setting varHighlight as true and highlighting the fields.

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

4 REPLIES 4

Hi @Gorilla_8 

 

To configure something like this, you can set the Border Color of Text Inputs or Input controls to Red or any other color of choice, when the user hits save button. 

 

Control -> BorderColor -> If(IsBlank(ControlName.Text), RGBA(highlighted color), RGBA(normal color))

 

Instead of this, you can also disable save button until all the required fields are filled.

Example: If(IsBlank(Control1.Text) || IsBlank(Control2.Text) || IsBlank(Control3.Selected.Value), displayMode.Disabled, DisplayMode.Edit) 

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Gorilla_8
Super User
Super User

@yashag2255 

 

Thanks, but I know this...

What I really wanted is to flash the field or something ... Complicate a little ...

@Gorilla_8 

 

In that case, you can setup the configuration as:

 

RequiredControls -> Border Color -> If(varHighlight && IsBlank(ControlName.Text), RGBA(highlightcolor),RGBA(normal color))

 

Save Button ->  If(IsBlank(Control1.Text) || IsBlank(Control2.Text) || IsBlank(Control3.Selected.Value), Set(varHighlight,true), Set(varHighlight,false)) ;If(varHighlight=false, SubmitForm(FormName)) 

 

Here, we are checking whether all the required fields are filled, it they are we are setting varHighlight  as false, and submitting the form, otherwise we are setting varHighlight as true and highlighting the fields.

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Gorilla_8
Super User
Super User

@yashag2255 

 

Hi, thanks for the help!

But how I can check if the field is required? Because, if the field is not visible and required he will show red border color and have an error...

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,491)