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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Hiding error message
Power Apps
Unanswered

Hiding error message

(2) ShareShare
ReportReport
Posted on by 557

Trying to get the Error message to go away if the field is filed out - any help is appreciated.  This is tied to a form that is pulling from SharePoint.  I only want it to show the error message if its blank.  (Note that this field is only visible dependent on another field).  Thank you.

Screenshot 2024-07-09 124950.png

Categories:
I have the same question (0)
  • KeithAtherton Profile Picture
    3,705 Most Valuable Professional on at

    Hi @joel914823,

     

    Can you share the code for the error message text label control (where it says "Resolved Date is Required") Visible property please?


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Connect with me online.

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @joel914823 - assuming you want to preserve the existing out-of-the-box behaviour (display the error warning once the user runs the SubmitForm function on a required field) - you could try:

     

    If(
     IsBlank(DateValue1.SelectedDate),
     Parent.Error
    )

     

    However, because the error message text (Parent.Error) is tied to whenever the data source returns an error, the error message text will continue to be displayed, even if the control inside the datacard has now been populated with a value.

     

    My preference is to control this behaviour more directly. For example:

     

    1. On the OnSelect property of your Submit Button (or whatever you're using to save the record), use:

     

    If(
     'Your Form'.Valid,
     SubmitForm('Your Form'),
     UpdateContext({ctx_highlight_field: true}),
     Notify(
     "Please complete all mandatory fields",
     NotificationType.Warning
     )
    )

     

    2. On the BorderColor property of the DataCard:

     

    If(
     ctx_highlight_field,
     Color.Red,
     Color.Transparent
    )

     

    3. Modify the Text property of the error message Label control with e.g. "The date field is mandatory."

     

    4. Set the Visible property of the Label to:

     

    ctx_highlight_field

     

    5. Set the OnVisible property of the Screen to: 

     

    UpdateContext({ctx_highlight_field: false})

     

    Optional: If the Item property of the EditForm is being populated from a Gallery control on the same screen, then on the OnSelect property of the Gallery, include:

     

    UpdateContext({ctx_highlight_field: false})

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard