# Filter data components

**URL:** <https://community.glideapps.com/t/filter-data-components/69893>\
**Category:** Ask for Help\
**Created:** [January 23, 2024, 12:03pm UTC](https://community.glideapps.com/t/filter-data-components/69893 "2024-01-23T12:03:07Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefania\_Oancea](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stefania_oancea/32/60457_2.png) [@Stefania\_Oancea](https://community.glideapps.com/u/Stefania_Oancea)\
**Post date:** [January 23, 2024, 12:03pm UTC](https://community.glideapps.com/t/filter-data-components/69893/1 "2024-01-23T12:03:07Z")

</div>

Hello,  
Can someone help me? I want to display the last registration number(Licence plate no.) entered by the driver, but not based on date because Saturday and Sunday the drivers don’t work and I can’t put the condition “Date is within yesterday” in filter data.  
Only one registration number appears in the print screen because only one is entered.

 ![GOOD](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/c/fc5bdd3b4f12140b50b4c37e7eb1cbe14b9c2026.png)  
 ![pontaj](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/8/986cf0c56ad5569360af2b0b01e9e63aa80006cc.jpeg)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 23, 2024, 12:30pm UTC](https://community.glideapps.com/t/filter-data-components/69893/2 "2024-01-23T12:30:45Z")

</div>

You have a bit of a challenge there, because you are using a Big Table.  
Before I attempt to offer any solutions, let me ask you something.  
If you only want the last plate number, why are you offering that in a choice component?  
Seems a bit pointless to have a choice component with only one option?

---

<div class="post-metadata">

**Author:** ![Stefania\_Oancea](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stefania_oancea/32/60457_2.png) [@Stefania\_Oancea](https://community.glideapps.com/u/Stefania_Oancea)\
**Post date:** [January 23, 2024, 12:35pm UTC](https://community.glideapps.com/t/filter-data-components/69893/3 "2024-01-23T12:35:00Z")

</div>

I’m still learning, this was a solution for me at that moment. If you have another idea, I want to hear it

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 23, 2024, 12:52pm UTC](https://community.glideapps.com/t/filter-data-components/69893/4 "2024-01-23T12:52:36Z")

</div>

Okay, so firstly I would ask why you chose to use a Big Table for this?  
Generally the only time you would choose a Big Table is if you are expecting tens of thousands of rows to be added. Is that the case?

---

<div class="post-metadata">

**Author:** ![Stefania\_Oancea](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stefania_oancea/32/60457_2.png) [@Stefania\_Oancea](https://community.glideapps.com/u/Stefania_Oancea)\
**Post date:** [January 23, 2024, 12:54pm UTC](https://community.glideapps.com/t/filter-data-components/69893/5 "2024-01-23T12:54:26Z")

</div>

Yes

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 23, 2024, 12:57pm UTC](https://community.glideapps.com/t/filter-data-components/69893/6 "2024-01-23T12:57:48Z")

</div>

Okay.

Sorry, but I have another question.

Will the selected driver always be the user that is submitting the form, or could a user submit and choose any driver?

---

<div class="post-metadata">

**Author:** ![Stefania\_Oancea](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stefania_oancea/32/60457_2.png) [@Stefania\_Oancea](https://community.glideapps.com/u/Stefania_Oancea)\
**Post date:** [January 23, 2024, 1:02pm UTC](https://community.glideapps.com/t/filter-data-components/69893/7 "2024-01-23T13:02:11Z")

</div>

The selected driver will only be the user that is submitting the form.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 23, 2024, 1:19pm UTC](https://community.glideapps.com/t/filter-data-components/69893/8 "2024-01-23T13:19:54Z")

</div>

Great, I was hoping you would say that. That makes it a bit easier.

So here is my suggestion. I’m not 100% certain this will work, but I think it should.

- You will need to add a column in your table to store the users email address (it’s good practice to do this anyway)
- Once you have that, in your table, create a Query column, target it at the same table and apply the following filter:  
– Driver email is signed in user  
– Also sort the query by Date in descending order
- Next add a Joined List column that targets the Plate number via the Query column. This should give you a list of all the logged plate numbers for that user, with the first one being the most recent one.
- Next you need a JavaScript column using the following code:

```auto
return p1.split(', ').shift();

```

- In the JavaScript column, replace `p1` with your Joined List. The JavaScript column should return just a single plate number, which is the one that you want.
- Now, back in your form, get rid of the choice component and replace it with a column value. The column value should take the value in the JavaScript column and write to the Plate number column.
- The other thing I would suggest is to remove the choice for driver selection, and instead pass the signed in users email as a special value with the form.

> **[Values | Glide Docs](https://www.glideapps.com/docs/reference/values#column-values)**
>
> The different types of values you can work with in Glide.

---

<div class="post-metadata">

**Author:** ![Stefania\_Oancea](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stefania_oancea/32/60457_2.png) [@Stefania\_Oancea](https://community.glideapps.com/u/Stefania_Oancea)\
**Post date:** [January 23, 2024, 1:23pm UTC](https://community.glideapps.com/t/filter-data-components/69893/9 "2024-01-23T13:23:55Z")

</div>

I will try, thank you very much. 👏

---

<div class="post-metadata">

**Author:** ![Stefania\_Oancea](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stefania_oancea/32/60457_2.png) [@Stefania\_Oancea](https://community.glideapps.com/u/Stefania_Oancea)\
**Post date:** [January 23, 2024, 2:15pm UTC](https://community.glideapps.com/t/filter-data-components/69893/10 "2024-01-23T14:15:39Z")

</div>

It worked!! 🥳

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 23, 2024, 2:21pm UTC](https://community.glideapps.com/t/filter-data-components/69893/11 "2024-01-23T14:21:23Z")

</div>

woah, that’s great!

I’m always a bit nervous when I offer up semi-complex solutions like this without having an opportunity to test. Glad it jot the job done for you 👍

---

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [January 23, 2024, 2:31pm UTC](https://community.glideapps.com/t/filter-data-components/69893/12 "2024-01-23T14:31:04Z")

</div>

“semi-complex”…don’t sell yourself short - I would call that complex.

JavaScript.returnFirstItem(Joined List of Plates(Query(sorted by date)) = Latest Plate # is a great technique.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 23, 2024, 2:37pm UTC](https://community.glideapps.com/t/filter-data-components/69893/13 "2024-01-23T14:37:57Z")

</div>

> [@MattLB](#):
>
> JavaScript.returnFirstItem(Joined List of Plates(Query(sorted by date)) = Latest Plate # is a great technique.

hehe, necessity is the mother of invention 😉  
I’ve done a lot of work with Big Tables, and that combo of Joined List & JavaScript has saved me many times…  
A Split Text/Single Value combo would do the same as the JavaScript column, but a single line of code is nice and efficient.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [January 30, 2024, 2:38pm UTC](https://community.glideapps.com/t/filter-data-components/69893/14 "2024-01-30T14:38:09Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
