Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

on change property notifications displays two times in play mode

(1) ShareShare
ReportReport
Posted on by 559
Hi all,
 
I have 2 date field in PowerApps. Planned start and Planned end date. If Planned start date is 8th August, then Planned end date cannot be selected before 8th August. If past dates are selected it will reset the Planned end date field. To satisfy this scenario I have added a condition in "on change " property of Planned end date.
If(
    !IsBlank(psdate_2.SelectedDate) && !IsBlank(peddate_2.SelectedDate) && peddate_2.SelectedDate < psdate_2.SelectedDate,
    Notify(
        "Planned End Date cannot be less than Planned Start date",
        NotificationTypeInformation,
        1000
    ) && Reset(peddate_2)
)
On save button also I have added the same code but with a variable.
If(
                                !IsBlank(psdate_2.SelectedDate) && !IsBlank(peddate_2.SelectedDate) && peddate_2.SelectedDate < psdate_2.SelectedDate,
                                UpdateContext({Plannedendate: true}) && Notify(
                                    "Planned End Date cannot be less than Planned Start date",
                                    NotificationType.Information,
                                    1000
                                ))
On reset property of Planned end date I have added If (Plannedendate = true, true, false).
So in both cases it will reset the Planned end date field when past dates are selected.
 
For me both the scenarios are working but the notification displays twice. I have attached screenshot for the same.
Any help/suggestion on this.
Thanks in advance.
Categories:
  • WarrenBelz Profile Picture
    146,670 Most Valuable Professional on at
    on change property notifications displays two times in play mode
    Hi  Sri,
    The fundamental issue is that the OnChange of a Combo Box triggers with the form is refreshed (such as when it it submitted) - if you also check that the data has actually been changed (the content does not match the data field), you should get rid of it
    If(
       !IsBlank(psdate_2.SelectedDate) && 
       !IsBlank(peddate_2.SelectedDate) && 
       peddate_2.SelectedDate < psdate_2.SelectedDate &&
       Self.SelectedDate <> ThisItem.YourDateField,
       Notify(
          "Planned End Date cannot be less than Planned Start date",
          NotificationType. Information,
          1000
       );
       Reset(peddate_2)
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,011 Most Valuable Professional

Leaderboard