Temporarily Hide a component

I’m trying to create a function that allows a user to click a button to temporarily hide a component, but my approach to using dates and a math column isn’t working.

What I want is when the user clicks the button to hide the thing, it records the current date and time. Then using visibility I want to say “show this item when that date and time is equal to or greater than 12 hours ago” so that it will reappear after 12 hours.

I used a math column to establish the duration between current time and when the user clicked the button. I wanted to use the “format duration” column to express the time elapsed in hours, but I would first have to convert the result of the math column to seconds and I can’t seem to figure out how to do that.

Is there a formula to convert the duration result in the math column to seconds?

Alternately, is there another approach to accomplish my idea of temporarily hiding a component?

Math column is the correct way to go. No need to grab seconds etc. Instead just add 12 hours to the original timestamp by adding 0.5 to the date. Then you can use this as a visibility condition on the component where “[math column] → is before → now.”

3 Likes

Gah! I overlooked the most obvious solution in favor of a far more complicated one. Thank you as always @Robert_Petitto!

2 Likes