web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set focus on required ...
Power Apps
Unanswered

Set focus on required field that is empty

(0) ShareShare
ReportReport
Posted on by

Hi all 

I have a form where i have 20 required fields. 

 

Suppose i have filled-in 5 fields from

The 20 mandatory fields and then i submit the form. I would like to focus automatically to one of the 15 empty fields randomly 

 

How to do this ?

 

Categories:
  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Hi @jd71 
    Can you explain a bit more?
    If there are 20 required fields, why are you allowing the user to submit only 5 of the 20 required fields?

  • jd71 Profile Picture
    on at

    Sure. 

    User is not allowed to submit without fill-in all 20 required fields.

     

    I'm using form.valid method to notify the user that some required fields are empty. 

     

    The problem is that those 20 required fields are splitted in different tabs on the form and when users receives the notify that say "you must fill in required fields" they don't know where are these required fields.

     

    That's why i would like to focus randomly to a required field that is empty. 

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Ahh - thanks for the explanation!
    I can take you part of the way there.

    You are going to have to build a collection that tracks the number of fields that have been filled in and in which tab.
    e.g. in the Onchange property of each control:

    Collect(
     colFormTracker,
     {
     tabName: "Tab1",
     FieldName: "DatePicker3"
     }
    )


    Then colour code your tabs. E.g. if you have 4 tabs with 5 fields in each tab. Count the number of fields that have been completed for the associated tab and colour the tab e.g. red if less than 5 fields have been completed or green if all 5 fields have been completed.
    This way the user knows which tab contains the empty field(s).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard