# Plurial

**URL:** <https://community.glideapps.com/t/plurial/29726>\
**Category:** Ask for Help\
**Tags:** custom-code\
**Created:** [July 30, 2021, 2:20am UTC](https://community.glideapps.com/t/plurial/29726 "2021-07-30T02:20:45Z")\
**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:** [July 30, 2021, 2:20am UTC](https://community.glideapps.com/t/plurial/29726/1 "2021-07-30T02:20:45Z")

</div>

Hello,  
a small code to facilitate the agreement in the plural of a text.  
The idea is to send as a parameter a text (column or fixed) and a number in order to determine whether to put the text in the plural.

EDIT Revision 3  
Deletion of the Criterion parameter  
Automatic detection of number column type for number, boolean, text use

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/6/46fdd3c70c621b548f074fc8e58902bc4ad27948.png)

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

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

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

---

<div class="post-metadata">

**Author:** ![Lucas\_Pires](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_pires/32/64863_2.png) [@Lucas\_Pires](https://community.glideapps.com/u/Lucas_Pires)\
**Post date:** [July 30, 2021, 2:23am UTC](https://community.glideapps.com/t/plurial/29726/2 "2021-07-30T02:23:49Z")

</div>

🤩🤩

That’s perfect!

What about male and female words/variations in Latin languages as ours? Should be awesome too 🤭

---

<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:** [July 30, 2021, 2:28am UTC](https://community.glideapps.com/t/plurial/29726/3 "2021-07-30T02:28:52Z")

</div>

Dude this is perfect. I said start a Notion page another day but may just redirect it to your forum profile.

---

<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:** [July 30, 2021, 2:31am UTC](https://community.glideapps.com/t/plurial/29726/4 "2021-07-30T02:31:02Z")

</div>

Hello @Lucas_Pires

Ah uhmmmm,  
do you have an example of distinction between mr and mrs based on a number?

---

<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:** [July 30, 2021, 2:41am UTC](https://community.glideapps.com/t/plurial/29726/5 "2021-07-30T02:41:08Z")

</div>

Thank you @ThinhDinh  
But I saw your Notion for CSS page and I find it great, simple, clear and easy. So it’s rather the opposite 🙂

---

<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:** [July 30, 2021, 6:53am UTC](https://community.glideapps.com/t/plurial/29726/6 "2021-07-30T06:53:07Z")

</div>

Merci @Manu.n, j’ai exactement eu ce dilemme du “pluriel” hier sur plusieurs champs où je ne savais pas comment faire qq chose de propre !  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/6/6674aa341d0565262fee6bbe93dffb9c234aaa80.png)

Bon, le seul pb, c’est que j’avais dit que je ne me penchais pas maintenant sur cette fonction YesCode (0 connaissance en JS, etc)…

Bonne journée

---

<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:** [July 30, 2021, 6:55am UTC](https://community.glideapps.com/t/plurial/29726/7 "2021-07-30T06:55:50Z")

</div>

bonjour @AyS_0908  
you can simply copy the code (fork function in replit)  
If you need a helping hand.  
Call me

---

<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:** [July 30, 2021, 7:03am UTC](https://community.glideapps.com/t/plurial/29726/8 "2021-07-30T07:03:07Z")

</div>

Thanks @Manu.n.  
Question about your code (sorry if it’s dummy, I am really at 0 level, even less, on this topic):

- can we apply the code to multiple columns with words requiring the Plural to be managed?
- or do we have to create 3 columns (if I understood well: date suivante /relscount || date suivante / titre || relscount) for each word?  
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:** [July 30, 2021, 7:12am UTC](https://community.glideapps.com/t/plurial/29726/9 "2021-07-30T07:12:27Z")

</div>

uhmm  
If you have several words in the same sentence: no problem, like my example:  
Date{s} Suivante{s}

But if you have several columns, you must use a new YC column each time.

In my example I’m referring to a relation column, but you can for example use this function like this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/9/69084bf4dd22ebfe788418691cc742037802813f.png)

If you want to test, you can use my code:  
place this link in the YC column  
https://pluriel.manun2.repl.co/

**EDIT**  
**but it is also possible not to have a txt column, and to put the text directly in the YC column**

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

---

<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:** [July 31, 2021, 12:22pm UTC](https://community.glideapps.com/t/plurial/29726/10 "2021-07-31T12:22:16Z")

</div>

Hi my friend,

I translated this code to English and had a bit of a different approach here.

> **[Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.](https://www.notion.so/glidecommunity/Experimental-Code-Library-27b07640f9f24db1aeb4629b74de0ad3?p=3a9ff7340119434895d638e73f7eb456)**
>
> A new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team

Input: Number & Singular/Plural format of the text (e.g: teacher/teachers, shelf/shelves, watch/watches). This covers all the cases when it’s not simply just “s”.

Output: Number and the right unit text. (1 is singular, 0 and \> 1 are plural)

If I recall right, @Darren_Murphy and @Robert_Petitto had been calling for this unit thing to be available for the math column/number column for so long.

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

---

<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:** [July 31, 2021, 12:29pm UTC](https://community.glideapps.com/t/plurial/29726/11 "2021-07-31T12:29:04Z")

</div>

If I can afford it.  
I made a criterion, to be able to also use boolean values ​​like Count values  
After, using the “/” as a marker can be “dangerous” like a “page 1/10” text suddenly it doesn’t work anymore.  
But your script is fine too

---

<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:** [July 31, 2021, 12:30pm UTC](https://community.glideapps.com/t/plurial/29726/12 "2021-07-31T12:30:30Z")

</div>

That’s a fair point. Maybe if it ever becomes a problem we switch to something no one ever uses like ♤ 😆

---

<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:** [July 31, 2021, 12:32pm UTC](https://community.glideapps.com/t/plurial/29726/13 "2021-07-31T12:32:12Z")

</div>

the {…} tag is a bit of a convention for replacement values

---

<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:** [July 31, 2021, 12:41pm UTC](https://community.glideapps.com/t/plurial/29726/14 "2021-07-31T12:41:37Z")

</div>

Brilliant!

---

<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:** [July 31, 2021, 12:44pm UTC](https://community.glideapps.com/t/plurial/29726/15 "2021-07-31T12:44:03Z")

</div>

Ultimately, it is easier to use 2 parameters for the text.  
Singular  
Plural

---

<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:** [July 31, 2021, 12:55pm UTC](https://community.glideapps.com/t/plurial/29726/16 "2021-07-31T12:55:57Z")

</div>

Pfffffffff  
As it is a good idea, Suddenly, I copied on you adding a flag to add the number. 😜 🤣

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/8/e82458726b27f96348ec2ea41469da8a0ca71118.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:** [July 31, 2021, 1:18pm UTC](https://community.glideapps.com/t/plurial/29726/17 "2021-07-31T13:18:49Z")

</div>

@Manu.n  
But what if the plural isn’t just adding an “s”?

Eg.  
woman \> women  
Foot \> feet  
Inch \> inches

---

<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:** [July 31, 2021, 1:21pm UTC](https://community.glideapps.com/t/plurial/29726/18 "2021-07-31T13:21:27Z")

</div>

I add an optional parameter for the particular case

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/5/d5389eb87f4dc507642e19ee4f215caddccee618.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:** [July 31, 2021, 1:24pm UTC](https://community.glideapps.com/t/plurial/29726/19 "2021-07-31T13:24:38Z")

</div>

Maybe I’m missing something here, but isn’t this use case a bit of overkill?

I mean, this is trivial with just an if-then-else column and a template, so why resort to code? 🤔

---

<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:** [July 31, 2021, 1:28pm UTC](https://community.glideapps.com/t/plurial/29726/20 "2021-07-31T13:28:43Z")

</div>

It is in fact a case of often encountered, it replaces 3 calculated columns (singular template, plural template, ifThen)

[Next page](https://community.glideapps.com/t/plurial/29726.md?page=2)
