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 / My closed date changes...
Power Apps
Unanswered

My closed date changes every time I open ticket details page.

(0) ShareShare
ReportReport
Posted on by 341

I have a date and time that auto populate date, hours, minutes based on when a ticket goes to closed status. The code works and the date auto fills when a ticket is closed. However, when I go back into ticket details it repopulates the date and time to when I open the details page. I need the date and time to stay the date and time of when the status was first closed.

 

Current codes shown below:

Date:

If(Or(DataCardValue61_1.Selected.Value="Closed"),Today(),Blank())

 

Hour:

If(Or(DataCardValue61_1.Selected.Value="Closed"),Text(Hour(Now())),Blank())

 

Minutes:

If(Or(DataCardValue61_1.Selected.Value="Closed"),Text(Minute(Now())),Blank())

 

Evan_S1_0-1682005356780.png

 

 

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,833 Super User 2026 Season 2 on at

    Hi @Evan_S1 ,

     

    You can do this by setting the OnChange property of the DataCardValue in which you select the status to:

     

     

    If(Self.Selected.Value = "Closed", UpdateContext({locClosedSelectedTime: Now()}))

     

     

     

    This saves the time at which Closed is selected in a variable (locCLosedSelectedTime). This variable can then be referenced in the Default( properties of your date/time field:

     

    Date:

     

     

    locCLosedSelectedTime

     

     

    Hour:

     

     

    Hour(locCLosedSelectedTime)

     

     

    Minutes:

     

     

    Minute(locCLosedSelectedTime)

     

     

     

  • Anchov Profile Picture
    1,986 on at

    You will need to update your formulas to something like this this (change field name as needed):

    If(And(IsBlank(ThisItem.'Closed Date'), DataCardValue61_1.Selected.Value = "Closed"), Today(), ThisItem.'Closed Date')

    Rinse and repeat for Hours and Minutes


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

    Cheers!
    Rick Hurt

  • Evan_S1 Profile Picture
    341 on at

    I am receiving the below error using your formula within the Default of my status datacardvalue.

    Evan_S1_0-1682012998979.png

     

  • BCBuizer Profile Picture
    22,833 Super User 2026 Season 2 on at

    Hi @Evan_S1 ,

     

    I seem to have missed a curly brace which I now added to the original post.

  • Evan_S1 Profile Picture
    341 on at

    Do I change the below function to what you provided?

    Current codes shown below (All in Default):

    Date:

    If(Or(DataCardValue61_1.Selected.Value="Closed"),Today(),Blank())

     

    Hour:

    If(Or(DataCardValue61_1.Selected.Value="Closed"),Text(Hour(Now())),Blank())

     

    Minutes:

    If(Or(DataCardValue61_1.Selected.Value="Closed"),Text(Minute(Now())),Blank())

    Evan_S1_0-1682013539045.png

     

     

  • BCBuizer Profile Picture
    22,833 Super User 2026 Season 2 on at

    Hi @Evan_S1 ,

     

    That's correct, you can replace the existing formulas.

  • Evan_S1 Profile Picture
    341 on at

    Ok I recv'd a bunch of errors.

     

    Evan_S1_1-1682014028275.png

     

    Evan_S1_4-1682014201826.png

     

     

    Evan_S1_2-1682014049964.png

    Evan_S1_3-1682014158298.png

     

     

     

  • BCBuizer Profile Picture
    22,833 Super User 2026 Season 2 on at

    Hi @Evan_S1 ,

     

    Slightly updated versions:

    Date:

     

    DateValue(locClosedSelectedTime)

     

    Hour:

     

    Text(Hour(locClosedSelectedTime),"00")

     

    Minutes:

     

    Text(Minute(locClosedSelectedTime),"00")

     

     

     

  • Anchov Profile Picture
    1,986 on at

    If you are trying to use my solution, you would add my code to the DefaultDate property of you Date control, not the Status data card.

  • Evan_S1 Profile Picture
    341 on at

    receiving a new error

    Evan_S1_0-1682015055984.png

    And just to confirm, i'm changing your (locClosedSelectedTime) with the name of where "closed" is selected?

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard