I’m designing a real estate service.
I would like to display only new objects for say a week using a switch.
Is it possible to implement this?
I can’t set up such a condition on my own.
How to work ? Through if the else or by some other parameters?
can you explain to me what do you mean by (say a week)
Displays cards for the last 7 days.
Those that were added earlier will not get into the filter. Only the latest ones from the last 7 days.
Easy to do:
Let’s say you have Timestamp as a date column
You need a math column - I’d call it mth-timestamp
And your formula it t + 7
With t being your timestamp
And 7 is days (1/24 is an hour, etc)
Then your inline list just needs a filter - show if the show until date is after ‘now’ (a glide thing that appears when you can use now)
@Mark_Turrell Can you tell me how to make timestamp a data source in switch?
Is it like this?
What is the switch supposed to do when you turn it on? Is it supposed to set a timestamp? Or is it supposed to be part of an additional filter to make that item show up? For example, if the item is created today with a timestamp of today, then the timestamp +7 as well as the switch needs to be on for the item to show in a list? Sorry, it’s not clear to me what the purpose of the switch is.
It only makes sense if it’s to turn on/off the “last 7 days” mode.
Say if you turn it on, show only items in the last 7 days.
If it’s off, show all items.
Yes, you are right.
So far I haven’t been able to set up such a display.
Perhaps I am doing something wrong.
Please look at the skinshorts and give advice.
First, you can have a math column to calculate a “time comparison” value. The formula would be:
T + 7 with T being the timestamp when your user submitted the object.
If T + 7 is after now, it means the object is “new”. Else it is “old”.
Next, about your “switch”. I assume only admins can access that switch, and that switch’s value is global (not user-specific).
You can have a table with a single row to store the value of that switch, then cast that to the objects table.
Finally, the visibility of each item will be determined by an If Then Else column.
If switch is not true then true (no limit on new or old objects)
If “time comparison” is before now then return null (limit to show only new objects, and objects that are old can’t be shown)
Else return true.
Show only objects that have the returned value being true.
Thank you very much. I will try to implement it.