cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

When a toggle is moved display timestamp

Hello all! 

 Can someone tell me how to display and or update a timestamp if a toggle is moved on and off? 

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: When a toggle is moved display timestamp

Oops my bad, I left it off.
UpdateContext({timestamp:Now(), showing:!showing})

View solution in original post

7 REPLIES 7
Highlighted
Super User
Super User

Re: When a toggle is moved display timestamp

Hi @brockjvl,

You do it with the UpdateContext() function.  On your Toggle OnChange property- UpdateContext({timestamp:Now(), showing:!showing). Put a TextInput box on the screen and set its Default property to timestamp, set its DisplayMode- View and set its Visible property- showing.  Now when you change the toggle, the TextInput box will display the timestamp in read only mode and when you toggle again, it will hide the textbox.  

Highlighted
New Member

Re: When a toggle is moved display timestamp

@Drrickryp ,

 Thank you for the reply. I will apologize up fron, but I am a complete noob with PowerApps. So I followed your steps, to the best of my knowledge, and I still seem to be having issues. Am I missing something, is my formatting wrong? Please take a look at my screenshots and see if I followed your directions properly.

 

 Again, thank you for your help. 

Highlighted
New Member

Re: When a toggle is moved display timestamp

 
Highlighted
Super User
Super User

Re: When a toggle is moved display timestamp

You left off the second curly brace in the OnSelect property of the toggle. If this answers your question place Mark it solved.
Highlighted
Super User
Super User

Re: When a toggle is moved display timestamp

Oops my bad, I left it off.
UpdateContext({timestamp:Now(), showing:!showing})

View solution in original post

Highlighted
New Member

Re: When a toggle is moved display timestamp

That worked! 

Thank you @Drrickryp for your assistance!

 

Highlighted
Super User
Super User

Re: When a toggle is moved display timestamp

Please mark the issue solved off you are happy with the answer.

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,144)