Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Am new to QV and was wondering if it was possible to make a text object disappear after x number of seconds. I'm looking to pop an info box up when someone opens a tab but want it to be removed after a set period of time.
Is this possible?
That's probably because the Second() command Alessandro has used picks up the second part of the time only, so will reset every minute and show again as long as the seconds elapsed for that minute are less than the seconds on timestamp + however many you dictated.
If you only want it to appear once, use:
Now() - vNow < 0.0001 (or replace 0.0001 with X/86400, where X is your number of seconds, so (5/86400) for 5 seconds..)
That will give you roughly 8.5 seconds - it translates the timestamp into a real value where 1 equals a full day, and so if you break a day into seconds (86400 of them!) you can translate your seconds requirement into X/86400.
Hope that makes sense!
If you use text box in presentation tab there is a "conditional show" box.
you can place there the condition to show the text box for some seconds
You can create a variable and then in the sheet properties there will be a triggers tab, set a trigger in here OnActivateSheet to set that variable to equal now() - that will timestamp when a user accesses the tab.
Then as Alessandro suggested, use this variable and add on whatever amount of time you want to, and you could use a condition that says where now() is less than your variable plus the time you want it to show for.
Thanks Alessandro, what would the condition syntax be please?
Thanks Alan, what would the conditional show look like pease if the variable set on activate was "vtextbox_visible"?
Second(Now())-Second(vTime) < 3
in the conditional view,
define
Let vTime = '';
in the script an finally, in the tab add a trigger -> external -> set variable write in the upper textbox vTime, in the bottom write
=Now()
let me know
Thanks Alessandro
The changes you suggested do work 🙂 but the text box re-appears ater 30 secs, then disappears again. This happens on a loop.
I think I'll change approach and put a button for them to click which clears (and accepts acknowledgement) the text box.
Thanks for looking at this though.
That's probably because the Second() command Alessandro has used picks up the second part of the time only, so will reset every minute and show again as long as the seconds elapsed for that minute are less than the seconds on timestamp + however many you dictated.
If you only want it to appear once, use:
Now() - vNow < 0.0001 (or replace 0.0001 with X/86400, where X is your number of seconds, so (5/86400) for 5 seconds..)
That will give you roughly 8.5 seconds - it translates the timestamp into a real value where 1 equals a full day, and so if you break a day into seconds (86400 of them!) you can translate your seconds requirement into X/86400.
Hope that makes sense!
Also worth mentioning however, the now() command being used in the frontend like that can be resource intensive, as it's constantly calling the function every second - so your other suggestion of a button to click and clear the message is probably a much better and more resource efficient one!