# Is there a way to access the state of the search box?

**URL:** <https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476>\
**Category:** Ask for Help\
**Created:** [June 5, 2023, 10:14pm UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476 "2023-06-05T22:14:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLA\_68](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@BLA\_68](https://community.glideapps.com/u/BLA_68)\
**Post date:** [June 5, 2023, 10:14pm UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/1 "2023-06-05T22:14:37Z")

</div>

Inspired by a grumpy client who could only see one item when there should have been 70, I want to see if there is a work around to this issue, while we wait for Glide to fix what is, as one person said, a very bad user experience on the search bar and the filter drop down:

> [@Clear search field automatically](https://community.glideapps.com/t/clear-search-field-automatically/58404):
>
> It’s a little unconventional that when you enter a search term in the search field it is persistent until you clear it, even months later. If a user enters a search term it collapses the list of items and then remains that way. Even as an experienced user, I’m often flummoxed coming back to a page in my app to find only one item on a page, until I remember to look at the search bar that I interacted with last time I used the site. Can it be made to clear the search term after the user navigat…

One thought I had was to be able to show a hint to the user that would display at the top of the page if list is filtered by either the filter or the search box. If you could access the state of either of those (which you probably can’t) or could somehow count the number of items that are being displayed against the total number of items, you could use that with the visibility setting to display the hint. Is that sort of thing possible? Any other ides on workarounds. It’s a pretty annoying issue.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 6, 2023, 12:12am UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/2 "2023-06-06T00:12:56Z")

</div>

The only way you can access this value is building your own “search bar” with a text entry and a user-specific column.

Then, if the user navigates somewhere in your app (except tab clicks), you can take advantage of that to add a set column action to clear the search value, but if they never go anywhere and just close the app then you’re stuck with 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:** [June 6, 2023, 1:55am UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/3 "2023-06-06T01:55:55Z")

</div>

Agree with Thinh, the workaround to this is to build your own custom search/filtering, with which you can also achieve the below:

> [@BLA\_68](#):
>
> could somehow count the number of items that are being displayed against the total number of items

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [June 6, 2023, 1:06pm UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/4 "2023-06-06T13:06:08Z")

</div>

> [@Clear search field automatically](https://community.glideapps.com/t/clear-search-field-automatically/58404/1):
>
> enter a search term in the search field it is persistent until you clear it, even months later.

There was a bug in Classic Apps that if you clicked the red ‘x’ to the right of the search field to clear the search box, it would clear the search box, but the search would still be in effect. You would still see only the items selected by your search term.

Glide recently fixed that, and at the same time modified the search so that if you select a searched item, when you return from the detail screen the search will be cleared and you will see all items again.

That is the behavior I am seeing lately. In fact, the behavior change is so noticeable that one user complained about it recently in this forum. I don’t imagine Glide will be modifying this behavior again; their focus is now on Apps.

---

<div class="post-metadata">

**Author:** ![BLA\_68](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@BLA\_68](https://community.glideapps.com/u/BLA_68)\
**Post date:** [June 9, 2023, 5:16am UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/5 "2023-06-09T05:16:42Z")

</div>

So I figured out a workaround in addition to the one suggested by @ThinhDinh which deals with the situation where they don’t close the app. It’s not perfect but it will work for now.

Basically, the search field itself is hidden by default and a button that says “search” appears. Clicking search hides the button and displays the search field. After sometime, the search field is hidden again and the button appears.

Clicking the “search” button tiggers an action that both clears the search value (if any) from the column (essentially clearing the search field) and adds a time stamp to a timestamp column.

A math column calculates how much time has elapsed between “now” and the time in the time stamp column (I.e. how long as it been since the person interacted with the search button). In a duration column I have set the time for how long I want to pass between when a person clicks search and when the process resets (e.g. 30 minutes).

In an ITE column called “hide search field”, I ask:" Is the time since the button was clicked, higher than the duration I’ve set? If so true; otherwise false." Finally, I created a “dummy” search field that is an ITE column that says “if hide search field is true, then blank; otherwise, display the value of this search field.” The value in the dummy column is the source of filter for the search, so when the time elapses and it clears, the list is restored to its full, unfiltered state. At the same time, the search field is hidden and the button is displayed. Clicking the button restarts the timer and the process…

---

<div class="post-metadata">

**Author:** ![Hobe](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hobe/32/55866_2.png) [@Hobe](https://community.glideapps.com/u/Hobe)\
**Post date:** [June 9, 2023, 4:27pm UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/6 "2023-06-09T16:27:01Z")

</div>

in the new applications, there was no change, the field remains filled.

---

<div class="post-metadata">

**Author:** ![BLA\_68](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@BLA\_68](https://community.glideapps.com/u/BLA_68)\
**Post date:** [June 9, 2023, 5:46pm UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/7 "2023-06-09T17:46:40Z")

</div>

Yep. Hoping it gets fixed. It’s an uncommon behavior.

---

<div class="post-metadata">

**Author:** ![Hobe](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hobe/32/55866_2.png) [@Hobe](https://community.glideapps.com/u/Hobe)\
**Post date:** [June 9, 2023, 6:32pm UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/8 "2023-06-09T18:32:47Z")

</div>

![prin1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/a/6a1d4b51e147b515f394c0379254ca35ba6ccc12.png)  
the impression that is left is that these are things that should be simple to solve. see, it wasn’t enough for the field not to be cleared, there is also an icon with an exaggerated transparency.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 10, 2023, 12:02am UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/9 "2023-06-10T00:02:53Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/2/92fd7d8fac67b129a737cfe811549350a2867361.png)

Can you tell me how to reproduce that? I can see the icon on my end.

---

<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:** [June 10, 2023, 1:26am UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/10 "2023-06-10T01:26:33Z")

</div>

> [@Hobe](#):
>
> there is also an icon with an exaggerated transparency.

Are you using a custom accent colour under Settings-\>Appearance?

 ![CleanShot 2023-06-10 at 09.24.36@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/7/67f803ecd2be3649b976b6464e4a12dc9617307c.png)

---

<div class="post-metadata">

**Author:** ![Hobe](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hobe/32/55866_2.png) [@Hobe](https://community.glideapps.com/u/Hobe)\
**Post date:** [June 10, 2023, 9:35am UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/11 "2023-06-10T09:35:41Z")

</div>

I’ve tried using custom and predefined color, the behavior is the same. this happens when my collection is inside a container with its backgrour “Accent” or " “image”.

 ![ex1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/4/841b77e0ffa981b43af2c6dc34bb0ed6466968c5.png)

 ![ex3](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/3/b32a1281eb68d2756c5515c9dfd11d2f1162a45f.png)

 ![ex4](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/a/fa57e12f7570e8f255f675ed864205c4396ca555.png)

---

<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:** [June 10, 2023, 9:43am UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/12 "2023-06-10T09:43:46Z")

</div>

ah yes, I see.  
Okay, I can replicate that. I’ll report it.

---

<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:** [July 1, 2023, 8:50pm UTC](https://community.glideapps.com/t/is-there-a-way-to-access-the-state-of-the-search-box/62476/13 "2023-07-01T20:50:21Z")

</div>

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