Note: This is a response I gave in a post. I decided to put it in the guide section to help someone else who needs to filter data in Airtable.
As the title says, the idea is to be able to obtain data corresponding to a certain specific date in Airtable.
First of all you have to know that working with dates is a little more complicated than working with just text.
I have a table on airtale with dates from 2019 to now.
And for airtable to sort them by date, you need to first tell airtable that you are going to work with dates.
For that you have to set the data type of the column:
(In the example I put the European format, but you can put another one.)
Important Note:
In all the tests I have done I always receive the date listing in ISO format (2020-04-07 for today’s date, for example).
This is very important because the date format of the DatePicker has to be the same as the date format we receive in the date list.
Well, with that in mind, we get the data from every column of Airtable we need.
For this example the format of my Airtable table is:
Now we get the data from each column. You can do it when you initialize the screen or with a button or whatever.
For each column we create a variable (initialized in empty list)
Here are the blocks to get each column:
We have each column in a variable.
Each variable is a list.
Now it’s a question of knowing where in each list the value we want to obtain is.
We need to create a list type variable that saves the position of the data we are looking for.
This value tells to us where the value is in the list:
So we create the variable “indexes” and give the DatePicker the ISO date format. And we make that for each value in the list, add the position in which it is in that list.
Note:
The value of label 1 is not necessary, I put it to see if everything goes well
ResultDate is a local variable that saves the dates in this case and puts them in a ListView. If instead of wanting to put the dates you want to put something else, just change the variable “date” and put another one.
The most important of this is the Foreach and the local variable ResultDate.
Having that you can put it in a ListView using HTML, or make it to show you the results at each date.
Something like this:
It would look something like this:
Or If you can display it like this in the ListView:
You have to use these blocks:
I hope this guide serves everyone who wants to filter data on Airtable.