# Search with criteria

**URL:** <https://community.glideapps.com/t/search-with-criteria/30731>\
**Category:** Ask for Help\
**Tags:** custom-code\
**Created:** [August 20, 2021, 6:51pm UTC](https://community.glideapps.com/t/search-with-criteria/30731 "2021-08-20T18:51:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 20, 2021, 6:51pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/1 "2021-08-20T18:51:57Z")

</div>

Hello,

\*\*UPDATE VERSION 2 !!! \*\*  
**I made a new version, see here:**

> [@Search with criteria](https://community.glideapps.com/t/search-with-criteria/30731/3):
>
> Hello, Spurred on by @Jeff_Hager , I made a new version. stuck_out_tongue_winking_eye There is only one criteria search which can be a list of words (full or partial) or a word or phrase in “” for an exact search. I also added a few more options. See the detail below: VERSION 2 \* Parameters \* \* String: string to search \* \* Separator: use of a specific character to separate the elements of an array. \* Returns the elements found separated from the same separator. \* …

version 1:  
I made a script for searches with several criteria and options.  
2 search criteria that can be combined by And or Or.  
An option to respect capitals and another option for accents.

The integration is pretty straightforward.  
The idea is a table with the search parameters with a template column grouping all the parameters. Then in the table to perform the search, make a single value column with the parameters template and a YC column for the search.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/d/ed73244fd8ea44b7eb6d9d826f781e99b355ad63.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/8/e85936bd511b824bf8a7d5240da8137da759adb5.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/7/b7e9eda773b3fc1d075d95f598f8e614385dbcf4.png)

Here is a small demo application.

> **[Demo YC Search](https://demoycsearch.glideapp.io/)**

YC link  
[https://Search-And-Or.manun2.repl.co](https://Search-And-Or.manun2.repl.co)

Source

---

<div class="post-metadata">

**Author:** ![AyS\_0908](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ays_0908/32/27349_2.png) [@AyS\_0908](https://community.glideapps.com/u/AyS_0908)\
**Post date:** [August 21, 2021, 7:49am UTC](https://community.glideapps.com/t/search-with-criteria/30731/2 "2021-08-21T07:49:15Z")

</div>

Hello @Manu.n, just feed for thoughts of an approach less advanced than yours, but without using the YC (for non experts as I am)

> [@mag\_right Glide: Search Box Tips and Tricks](https://community.glideapps.com/t/glide-search-box-tips-and-tricks/23959/8):
>
> Thanks @Robert_Petitto. Even if it is not a native Glide function, I share an approach to build ‘Advanced Search’ feature for end-users. Objective being to have different choice components which are independent the one from the other Illustration with a list of projects to search per different criteria [https://www.loom.com/share/8848eda6e9dd4b58bebf673d3c15d42f](https://www.loom.com/share/8848eda6e9dd4b58bebf673d3c15d42f) =\> IN DATA EDITOR: Tab: [Project] User email Project TYPE Project STATUS Project VISIBILITY User Specific TYPE Sin…

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 23, 2021, 12:01pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/3 "2021-08-23T12:01:56Z")

</div>

Hello,  
Spurred on by @Jeff_Hager , I made a new version. 😜  
There is only one criteria search which can be a list of words (full or partial) or a word or phrase in “” for an exact search. I also added a few more options. See the detail below:

VERSION 2

```auto
* Parameters
 * 
 * String: string to search
 * 
 * Separator: use of a specific character to separate the elements of an array. 
 * Returns the elements found separated from the same separator.
 * (Search for example in a 'Joined List').
 * 
 * Escape characters: replaces the characters with a space, allows searches 
 * to be insensitive to certain characters 
 * (such as for example city names with a '-')
 * 
 * Search: search criteria, either a list of words (complete or partial) to search, 
 * or a word or an expression between "" for an exact search
 * 
 * Uppercase: uppercase Sensitive.
 * (1 : active, 0 : inactive (default))
 * 
 * Ignore Accent: ignore accents in the search.
 * (1 : active, 0 : inactive (default))
 * 
 * Word: searches only whole words
 * (1 : active, 0 : inactive (default))
 * 
 * ------------------------------------------------------------------------
 * Remarks
 * Spaces at the beginning and at the end are automatically removed.
 * The order of words in the search does not matter.

```

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/0/30cae7e51b1e5dbb549716e0b2e63d5c8d644f6f.png)

Demo

> **[Test YC Search V2](https://ycsearchv2.glideapp.io/)**

Link YC  
[https://Search-V2.manun2.repl.co](https://Search-V2.manun2.repl.co)

Source

> **[Search V2](https://replit.com/@ManuN2/Search-V2?v=1)**
>
> Public

---

<div class="post-metadata">

**Author:** ![POWH\_RPS](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/powh_rps/32/1666_2.png) [@POWH\_RPS](https://community.glideapps.com/u/POWH_RPS)\
**Post date:** [September 4, 2021, 10:05pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/4 "2021-09-04T22:05:33Z")

</div>

HI all,  
is it possible to make the “experimental code” column to be “user specific”? I was not able to do it…

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [September 4, 2021, 10:11pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/5 "2021-09-04T22:11:40Z")

</div>

Hello @  
Uhmm no the YC column is like a calculated column (math, template, …).  
To do a user-specific search, the entry columns (search and option) are specific.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/a/da2a85b3ac0fcac3291a7521fab57c24b90f8013.png)

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [September 4, 2021, 10:59pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/6 "2021-09-04T22:59:38Z")

</div>

I mean…it would be user specific if it’s referencing a user specific column…

---

<div class="post-metadata">

**Author:** ![POWH\_RPS](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/powh_rps/32/1666_2.png) [@POWH\_RPS](https://community.glideapps.com/u/POWH_RPS)\
**Post date:** [September 4, 2021, 11:10pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/7 "2021-09-04T23:10:14Z")

</div>

@Manu.n I understand that the choices would be user specific, but also the results should be. Is @Robert_Petitto meaning that if the result is based on user specific columns, the result would be different for any user?  
To make it an easy question, have you tried this app with multiple users? Do they get to search and get different results contemporarily?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 4, 2021, 11:18pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/8 "2021-09-04T23:18:29Z")

</div>

The experimental code column, and any glide calculated column for that matter, will run on each user’s device, so it’s going to run with whatever value is available to that specific user. If you pass it user specific column values, then the result will be user specific. If you pass it a value that’s available to everyone, then everyone will get the same result. But no matter what, that code runs on the user’s device, so the result will be based on the values that are being passed to it from that user’s device. It will not effect other users.

---

<div class="post-metadata">

**Author:** ![POWH\_RPS](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/powh_rps/32/1666_2.png) [@POWH\_RPS](https://community.glideapps.com/u/POWH_RPS)\
**Post date:** [September 5, 2021, 12:18am UTC](https://community.glideapps.com/t/search-with-criteria/30731/9 "2021-09-05T00:18:44Z")

</div>

Thanks @Jeff_Hager therefore it will work!

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [September 5, 2021, 12:39am UTC](https://community.glideapps.com/t/search-with-criteria/30731/10 "2021-09-05T00:39:50Z")

</div>

For information :  
I would love to be able to share this application, but with the presence of a YC column this is not possible.

---

<div class="post-metadata">

**Author:** ![POWH\_RPS](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/powh_rps/32/1666_2.png) [@POWH\_RPS](https://community.glideapps.com/u/POWH_RPS)\
**Post date:** [September 5, 2021, 5:35am UTC](https://community.glideapps.com/t/search-with-criteria/30731/11 "2021-09-05T05:35:08Z")

</div>

Hi @Manu.n I am trying to integrate your search code into my app, but I am not understanding exactly how to do it. Up to now, I have done the following:

1. In the main data tab, I have created a template column cumulating all the text to search within

2. I have added 7 user specific columns, each one for the parameters you use: “String”, “Separator”, “Escape”, “Search”, “Uppercase” (boolean), “Accent” (boolean), “Word” (boolean)

3. I have added an Experimental Code column, linking to your code, and indicating for each parameter the respective column

4. I have added an If-Then-Else column indicating IF the Experimental Column is not empty, write “FOUND”, else leave it blank

Obviously it does not work… and I kind of understand why. The search parameters should leave in one row, but the search should be conducted on all the rows. So, I think I messing up the mechanism a little…  
Can you help? Thanks

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [September 5, 2021, 5:58am UTC](https://community.glideapps.com/t/search-with-criteria/30731/12 "2021-09-05T05:58:16Z")

</div>

Hello @POWH_RPS  
All is well.  
you just need to add for each parameter modified by the user a column like single value to repeat in the whole table.  
Here is a sample structure of my sample lookup on the user table.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/a/1a792ac311ceb20ff5b49752b16ab77d3f5b5f67.png)

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

---

<div class="post-metadata">

**Author:** ![POWH\_RPS](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/powh_rps/32/1666_2.png) [@POWH\_RPS](https://community.glideapps.com/u/POWH_RPS)\
**Post date:** [September 6, 2021, 12:14am UTC](https://community.glideapps.com/t/search-with-criteria/30731/13 "2021-09-06T00:14:46Z")

</div>

Thanks @Manu.n it works great!

---

<div class="post-metadata">

**Author:** ![Alex\_x](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alex_x/32/40495_2.png) [@Alex\_x](https://community.glideapps.com/u/Alex_x)\
**Post date:** [March 15, 2022, 9:44pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/15 "2022-03-15T21:44:41Z")

</div>

@Manu.n I can’t seem to get the right result with your sample app.

Is it simply looking for a match with at least one word? e.g., “de”

EDIT. I ended up building my own repo with the Flexsearch library.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/d/fdb8894b5b37ee195b99ccdc08b2345e1be949c1.png)

---

<div class="post-metadata">

**Author:** ![jorgeleon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jorgeleon/32/23516_2.png) [@jorgeleon](https://community.glideapps.com/u/jorgeleon)\
**Post date:** [May 9, 2022, 12:33pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/16 "2022-05-09T12:33:33Z")

</div>

Is there a native solution to ignore the accents in search? I mean, without dealing with this more advanced mod.

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [May 28, 2022, 6:39pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/17 "2022-05-28T18:39:30Z")

</div>

I think you could do that with the remove text accents plugin. Then take your inline list and target the new plugin column.

> **[Remove Text Accents column • Glide](https://www.glideapps.com/plugins/deburr)**
>
> Deburrs string by converting Latin-1 Supplement and Latin Extended-A letters to basic Latin letters and removing combining diacritical marks.

---

<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:** [May 28, 2022, 11:22pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/18 "2022-05-28T23:22:20Z")

</div>

To add to this, Eric meant you should add a user-specific column and have a text entry at the top of your screen to mimic the native search.

Then, on the backend, create a computed column to remove accents, and then use that result to show/hide items in the inline list.

---

<div class="post-metadata">

**Author:** ![jorgeleon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jorgeleon/32/23516_2.png) [@jorgeleon](https://community.glideapps.com/u/jorgeleon)\
**Post date:** [May 29, 2022, 7:40pm UTC](https://community.glideapps.com/t/search-with-criteria/30731/19 "2022-05-29T19:40:58Z")

</div>

I solved it… I shared what I did in this thread: [Request for a better "search bar" capability - #15 by jorgeleon](https://community.glideapps.com/t/request-for-a-better-search-bar-capability/22787/15)

---

<div class="post-metadata">

**Author:** ![AyS\_0908](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ays_0908/32/27349_2.png) [@AyS\_0908](https://community.glideapps.com/u/AyS_0908)\
**Post date:** [March 26, 2023, 10:07am UTC](https://community.glideapps.com/t/search-with-criteria/30731/20 "2023-03-26T10:07:36Z")

</div>

Hi @Manu.n,

Your script seems great!

In your opinion, is it still the best options given the current evolutions of Glide?

Thanks

---

<div class="post-metadata">

**Author:** ![Manu\_Marea](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu_marea/32/21714_2.png) [@Manu\_Marea](https://community.glideapps.com/u/Manu_Marea)\
**Post date:** [March 28, 2023, 10:04am UTC](https://community.glideapps.com/t/search-with-criteria/30731/21 "2023-03-28T10:04:01Z")

</div>

Not the right Manu here but the so clever Manu n
