Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: Gustavo on July 31, 2018, 10:41:52 PM

Title: Snapshot of current date and time
Post by: Gustavo on July 31, 2018, 10: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:

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.
Title: Re: Snapshot of current date and time
Post by: Nikolay on July 31, 2018, 11:14:46 PM
Try changing the position of the parentheses?

SETF(GETREF(User.cell1),GETVAL(User.now)+dependson(Prop.settime))
Title: Re: Snapshot of current date and time
Post by: Gustavo on August 01, 2018, 05:58:38 PM
That did the trick! ;D ;D Thank you Nikolay!
Title: Re: Snapshot of current date and time
Post by: wapperdude on August 01, 2018, 07: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
Title: Re: Snapshot of current date and time
Post by: Gustavo on August 20, 2018, 08: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