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 / Notification error sho...
Power Apps
Unanswered

Notification error showing up even when if condition isn't met.

(0) ShareShare
ReportReport
Posted on by 2

Hi!

I'm brand new to learning Power Apps and don't have any experiencing with coding, so if the answer is obvious, or the way I talk about the code is incorrect, please be patient with me.

Problem:

The following code placed on a submit button for a patch of several forms, is working properly.  However, it is NOT posting the success command at the end of the second If statement.

 

By "working properly" I mean that the If statement functions as it should in terms of whether or not it runs the patch, based on the date.  What's not working, again, is that it will display the error "Week ending date is in the past, Please see office administrator for past due time entries" whether it runs the patch command (or not). 

 

 

If(DateTimeValue(DataCardValue4) < Now(),
Notify("Week ending date is in the past, Please see office administrator for past due time entries",NotificationType.Error),
If(!IsBlank(DataCardValue1)
&& !IsBlank(DataCardValue6)
&& !IsBlank(DataCardValue4),
Patch('Employee Timesheet',
Defaults('Employee Timesheet'),
Form1.Updates,Form2.Updates,Form3.Updates,Form4.Updates,Form5.Updates,Form6.Updates);
NewForm(Form1);
NewForm(Form2);
NewForm(Form3);
NewForm(Form4);
NewForm(Form5);
NewForm(Form6);
ResetForm(Form1);
ResetForm(Form2);
ResetForm(Form3);
ResetForm(Form4);
ResetForm(Form5);
ResetForm(Form6);
Notify("Your time has been submitted",NotificationType.Success),
Notify("Please check required fields",NotificationType.Error)))

 

 

Categories:
I have the same question (0)
  • Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at

    @bdrupp 

     

    try to replace Now() with Today().

    Using Now() in this formula should always return true.

  • bdrupp Profile Picture
    2 on at

    Thanks Alex.

    I tried that and the app still works properly with the exception of the the notification.  It's almost like it's using the notification for both true and false statements, which doesn't make sense to me. 

  • Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at

    @bdrupp 

     

    it looks like DateTimeValue(DataCardValue4) < Now() is always true.

    To verify that, you can test:

     

     

    If(
     IsBlank(DateTimeValue(DataCardValue4),
     Notify( "Blank data", NotificationType.Error ),
    
     DateTimeValue(DataCardValue4) < Now(),
     Notify( DateTimeValue(DataCardValue4) & "--", NotificationType.Error ),
     
     If(!IsBlank(DataCardValue1) && !IsBlank(DataCardValue6) && !IsBlank(DataCardValue4),
     
     Patch('Employee Timesheet', Defaults('Employee Timesheet'), Form1.Updates, Form2.Updates, Form3.Updates, Form4.Updates, Form5.Updates, Form6.Updates );
     NewForm(Form1);
     NewForm(Form2);
     NewForm(Form3);
     NewForm(Form4);
     NewForm(Form5);
     NewForm(Form6);
     ResetForm(Form1);
     ResetForm(Form2);
     ResetForm(Form3);
     ResetForm(Form4);
     ResetForm(Form5);
     ResetForm(Form6);
     Notify("Your time has been submitted",NotificationType.Success),
     
     Notify("Please check required fields", NotificationType.Error)
     )
    )

     

     

     

     

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 387

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 301

Last 30 days Overall leaderboard