Author Topic: Snapshot of current date and time  (Read 1010 times)

0 Members and 1 Guest are viewing this topic.

Gustavo

  • Jr. Member
  • **
  • Posts: 45
  • The ultimate inspiration is the deadline.
Snapshot of current date and time
« on: July 31, 2018, 05:41:52 PM »
Hello all.

I want to write a snapshot of current date/time to a user cell (lets call it User.cell1), when a property cell (Prop.settime) has a change in its value. My approach was, in some other user cell named ( User.now=NOW() ), and in other cell using the formula:

Code
 SETF(GETREF(User.cell1),GETVAL(User.now))+dependson(Prop.settime)

but this writes the NOW() formula, instead of the time snapshot.

Please could you point me in the right direction? best regards.

Nikolay

  • Hero Member
  • *****
  • Posts: 1007
    • UnmanagedVisio
Re: Snapshot of current date and time
« Reply #1 on: July 31, 2018, 06:14:46 PM »
Try changing the position of the parentheses?

SETF(GETREF(User.cell1),GETVAL(User.now)+dependson(Prop.settime))

Gustavo

  • Jr. Member
  • **
  • Posts: 45
  • The ultimate inspiration is the deadline.
Re: Snapshot of current date and time
« Reply #2 on: August 01, 2018, 12:58:38 PM »
That did the trick! ;D ;D Thank you Nikolay!

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3855
  • Ideas Visio-lized into solutions
Re: Snapshot of current date and time
« Reply #3 on: August 01, 2018, 02:27:47 PM »
I think part of the problem with your original syntax is the GETVAL().  It's not needed.

Being bored, I took a slightly different approach and created an action entry rather than a shapedata entry.  All you do is right click shape, then just click on the "Update Time", and current time value is applied.  The formula is:  SETF(GetRef(User.MyTime),NOW())+DEPENDSON(Actions.NowTime).

This approach only requires two entries:  1) User.MyTime to hold the time value, and 2) Actions.NowTime to invoke the time updating.
See attached.

It was fun to goof around.

Wapperdude
« Last Edit: August 02, 2018, 10:12:07 AM by wapperdude »
Visio 2019 Pro

Gustavo

  • Jr. Member
  • **
  • Posts: 45
  • The ultimate inspiration is the deadline.
Re: Snapshot of current date and time
« Reply #4 on: August 20, 2018, 03:56:22 PM »
Hi Wapperdude, thank you for your insight.  :) The approach on the action cell is also valid. The purpose on my first post wasn't to make a manual update of date/time value, but instead to make a postprocessing to that value, i.e. calculate a date/time after or a date/time before to do some tasks, like in project management, and this to be triggered by the selected value of a property cell. Or maybe triggered by some external data applied to a shape, as it writes in a property cell. But you're right, working with dates and times in Visio is a lot of fun.   ;D