Filter model for events within next X minutes?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
How can I filter a model to only show events within the next X minutes (refreshed with each page reload)?
Photo of Allison

Allison

  • 360 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Hi Allison~
Here is what
I’ve come up with to address your scenario:

From the setup menu, I first created
a number of custom fields on the opportunity object:

  • A date time field
  • A formula field to calculate the time
    between now and your date time field
  • A formula field (“time from now”) that
    categorizes your above formula field into groupings based on the time frames
    you want in the filter later



Here is what the filter looks like on the list view for opportunities:


On the Skuid
end, here is what I did in the composer to build the above filter:

  • Added a model condition to the
    opportunity model that is filterable default off based on the “time from now”
    field




  • Added a filter in the table component that uses the select option (filter type) and manual pick options against my condition above




  • Specified the source as manual and added values based on the values from the “time from now” field




Hope that works for you!

Karen
(Edited)