cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ram3
Microsoft
Microsoft

How to capture timestamp on a Boolean Value change?

Hello,

I have two fields, "Reviewer Sign Off" and "Reviewer Timestamp".

Reviewer Sign off - Boolean Switch

Reviewer Timestamp - Date and time

 

What I'm trying to do is, when Reviewer sign off is switched to true, capture the date and time in Reviewer timestamp field.

 

I tried the below but it is not working.

For Reviewer Sign off, OnChange property, If('Reviewer Sign Off_DataCard1'=true, Set('Reviewer Timestamp_DataCard1', Now()))

But, this is not working and I'm getting an error in the formula.

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@Ram3 

Use a textinput box and set its Default to a context variable, in the example "datetime".  To delete it set the toggle OnUncheck property to UpdateContext({datetime: Blank()}).  DatePickers don't show the time and date, only the date.  To show more than the date see https://powerusers.microsoft.com/t5/Building-Power-Apps/Date-Time-Picker-Missing-Time/td-p/49940 !1.png

View solution in original post

3 REPLIES 3
Drrickryp
Super User
Super User

@Ram3 

Use a textinput box and set its Default to a context variable, in the example "datetime".  To delete it set the toggle OnUncheck property to UpdateContext({datetime: Blank()}).  DatePickers don't show the time and date, only the date.  To show more than the date see https://powerusers.microsoft.com/t5/Building-Power-Apps/Date-Time-Picker-Missing-Time/td-p/49940 !1.png

Ram3
Microsoft
Microsoft

thank you for the prompt response, this worked...

Ram3
Microsoft
Microsoft

@Drrickryp I just noticed that, the now() value keeps on changing. I do not want it to change continuously. I only want the value to be updated with the current date and time when the Boolean switch is toggled to True, not update to current date and time every time I open the form. How do I make this constant?

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,326)