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 / display error message ...
Power Apps
Answered

display error message when field is empty and not move to other screen untill not filled data

(1) ShareShare
ReportReport
Posted on by 525

Hello ,

 

I want to display error message on create record screen as well my data source from SP list and on form data field I have error message label . 

 

how do I utilize this error label to show error message when someone hit save button without filled data and also dont navigate success screen if user not filled data?

I enabled require property on every DataCard true and also from SharePoint list i make as an require 

 

also I set the message on label text property which I want to show. 

 

mbhatt_1-1681811734980.png

 

 

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

    Hi @mbhatt,

     

    Try code similar to the following, and set your error message Visible properties to locShowPrimaryIssueErrorMessage, etc:

     

    UpdateContext({locIsFormValid:true});
    
    // Check required inputs contain values.
    If(IsBlank(txtPrimaryIssue.Text),
     UpdateContext({locShowPrimaryIssueErrorMessage:true});
    	UpdateContext({locIsFormValid:false});
    );
    
    // TODO: Repeat for other required input controls.
    
    // If form is valid then save data and navigate to next screen.
    If(locIsFormValid,
    	SubmitForm(frmCreateTicket);
    	Navigate('Success Screen');
    );

     


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

  • mbhatt Profile Picture
    525 on at

    Hello 

     

    @KeithAtherton 

     

    can you assit me step by step where i apply codes

     

    mbhatt_0-1681818752001.pngmbhatt_1-1681818777764.png

     

  • Verified answer
    KeithAtherton Profile Picture
    3,707 Most Valuable Professional on at

    Sure, try the following:

     

    • Change the "Create Ticket" button OnSelect property to the code block in my last message
    • Set the Primary Issue error text label Visible property to locShowPrimaryIssueErrorMessage
    • Test the form with Primary Issue set blank (i.e. show error message) then test the form with Primary Issue set to a value (i.e. navigate to success screen)
    • If everything works as expected, follow the same pattern for all other required controls on the screen

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

  • mbhatt Profile Picture
    525 on at

    HI 

     

    Look This i get an error while using same logic 

    mbhatt_0-1681820129613.pngmbhatt_1-1681820155835.png

     

  • mbhatt Profile Picture
    525 on at

    Hello 

     

    @KeithAtherton 

    also i have labeled error message on text property of error label 

    mbhatt_2-1681820268593.png

     

  • KeithAtherton Profile Picture
    3,707 Most Valuable Professional on at

    Those screenshots look different from my step-by-step instructions.

    Try the steps in my last message, and see if it works.


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

  • mbhatt Profile Picture
    525 on at

    Hello 

     

    @KeithAtherton 

     

    so let me show my steps 

    step 1 i apply this code on save button icon 

    UpdateContext({locIsFormValid:true});

    step 2 i apply this code on visible property of DataCard error  label property 

    If(IsBlank(txtPrimaryIssue.Text),
     UpdateContext({locShowPrimaryIssueErrorMessage:true});
    	UpdateContext({locIsFormValid:false});
    );

    step 3 on save button icon property i apply this code with my some changes of my form name 

    If(locIsFormValid,
    	SubmitForm(frmCreateTicket);
    	Navigate('Success Screen');
    );

     

    in my case i have form from sp list and all DataCard have error label and i want to show message that "field is required "

     

  • mbhatt Profile Picture
    525 on at

    Hello 

     

    @KeithAtherton 

    what's the solution ? 

    could you please assist step by step ?

  • KeithAtherton Profile Picture
    3,707 Most Valuable Professional on at

    I've already provided step-by-step instructions in a previous message, please try them.


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

  • mbhatt Profile Picture
    525 on at

    Hello,

     

    @KeithAtherton 

     

    I got an error on datacard error label when i use this 

    mbhatt_0-1681840212014.png

    mbhatt_1-1681840250860.pngmbhatt_2-1681840279327.png

    didn't understand your explain i used updatecontext({locisformvalid:true})

    i also use this on save as you can see in screenshot. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard