Swipe cards based on Date

Hi Gliders

So this may seem very basic (or possibly not), but I’m trying to achieve something like this:

Swipe List, which includes…

  • Date picker - defaults to today’s date, however user can select any date from it, which I’ll set to Range “today or earlier”
  • Inline list, with entries that correspond to specific dates, essentially ‘journal entries’ - in this case it should show all entries for the date specified in the date picker
  • Swipe left for previous date, swipe right for next date (or can’t swipe right if it’s the last card, i.e. today’s date)

I’ve added the components for each of the above, but I can’t seem to get them working.

I assumed that maybe there needed to be a ‘chosen date’ column which the date picker pulls from, and the inline list filters on all entries which match to this ‘chosen date’ value.

However:

  1. I’m not sure how to default the ‘chosen date’ column to today’s date. I tried something like the below, with a Math column to get today’s date and an ITE column where it uses today’s date if ‘Chosen Date’ is blank otherwise pulls in Chosen Date, but I’m not sure how to get something to populate the Chosen Date column.

  1. I’m not sure how to set up the swipe list so that swiping left goes to the previous date, swiping right goes to the next date etc. I presume I could this working if it could use the ‘Chosen Date’ column and add or subtract a day…?

Could someone please help with solving this somehow?

The problem here is that you are trying to set a default value on a column in a row that already exists. What if that date is already set. In a lot of cases it doesn’t make sense to set a default when a value already exists (blank or not). To get around that, you would have to set up your app flow so user performs some sort of action to get to that screen (such as pressing a button, or clicking on a list item). Something where you can set an action that would set that chosen date to todays date before they get to that screen.

I also want to mention that it looks like your Chosen Date column is not user specific. This could cause conflicts if multiple people are using the app at the same time, and updating the date at the same time.

Also, functionality like you want is a bit hard to explain with the way that swipe works. Essentially you need to have only one row accessible to the swipe, and each swipe could be set up to change the date, but it will always be swiping to the same row in the table. Complicated to understand and explain, so I suggest checking out the following app. You can make a copy of it. I did something like this with a calendar and swiping to change the month. You can largely ignore all of the extra stuff to build the calendar, but pay attention to how I set up the swiping functionality and how it affects the first row in MonthLayout table. I couldn’t find any posts where I went into an in-depth explanation of the process, but hopefully you can figure something out.

3 Likes

Ah yes, I see what you mean on both points! Thanks for the comprehensive response Jeff.

I’ll dig around the calendar app and apply what you’ve mentioned, then report back within the next day or so - hopefully I don’t get stuck but will shout if so.

1 Like