# Showing a random value from 3 columns

**URL:** <https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257>\
**Category:** Ask for Help\
**Created:** [July 17, 2025, 1:53pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257 "2025-07-17T13:53:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 17, 2025, 1:53pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/1 "2025-07-17T13:53:07Z")

</div>

Hello there,

I have 3 columns :

- Motto
- Guilty pleasure
- Shortcoming

I would like to display randomly in a Hint component only 1 quote from one of this 3 columns and avoid empty cells.  
And every time the user hit the component, it displays an other quote randomly.

Thanx for your help 🙏

---

<div class="post-metadata">

**Author:** ![Nicolas\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_joseph/32/76105_2.png) [@Nicolas\_Joseph](https://community.glideapps.com/u/Nicolas_Joseph)\
**Post date:** [July 17, 2025, 6:56pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/2 "2025-07-17T18:56:57Z")

</div>

Hi @Korbib 🙂

Assuming you have a **`Users`** table to enable User Profile based computed columns, here’s a functional approach.

### In your **`Quotes`** table

**Expected result**

 ![Quotes table](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/6/16a1eb218ac4688cc1de75b04bbb4cdc8beddd19.png)

**Step by Step**

1. For each column containing quotes (i.e. _Motto_, _Guilty pleasure_ and _Shortcoming_), create a _Joined List_ of all values:  

2. Store all values from these 3 columns in a single one thanks to a _Template_ column, just like this:  

3. Convert this _Template_ column into an array, using a _Split Text_:  

  

### In your **`Users`** table

**Expected result**

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

**Step by Step**

1. Get the _All 3 colmuns in array_ column from `Quotes` using a _Single Value_:  

2. Add a _Previous quote_ column (_Text_) to store the displayed quote:  

3. Get the list of all quotes available (for the next hit on the button), let’s call it _All 3 columns without previous quote_. It’s a _Remove Element_ column:  

4. Count the number of available values using a _Rollup_ based on the column we’v just created (_Count of values in array without previous quote_):  

5. Add a _Date & Time_ column in order to store the exact moment the user hits the button. Our random will be based on that later on (_Date and Time for Random_):  

6. Create a _Random Number_ column. I named it _Random 0→1_ to make it different from the next one we’ll add just after that:  

7. With a _Math_ column, we define the index of the quote we’ll display next (_Random on Count_). The formula is the following: `FLOOR(random*count)`.  

8. Another _Math_ column to help us slicing the array - _Random on Count + 1_:  

9. Now we can extract the next quote thanks to all previously created columns. It’s _New quote_, a _Slice Array_ column:  

10. Lastly, we need the data as a text instead of an array to make it useable in a component. _New quote in text_, a _Joined List_ column will be useful for this purpose:  

  

### In your Layout

**Expected result**  
 ![Layout](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/e/6e91d2cc53e7346af4b715837b8df8fca3605ff8.gif)

- The main point here is the _Button_ setup, so here it is:  
 ![Button setup](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/e/0e5335a0a748e0b6340184a9329c5bd2dce258b3.png)

> When the User will hit the button, it’s going to change the _Date & Time for Random_ column. The value will be used to define a value between 0 and the total number of quotes - 1 (we don’t want to reach the same quote again).  
> Because we have replace the _Previous quote_ with the one we displayed, you can be confident on the fact it will not pop for this new draw.  
> And it deals with empty cells, as you can see in the **`Quotes`** table: I intendty not filled all cells for this exact reason: as you can see, everything works fine 😉

  

Is this what you were looking for? 🤔

---

<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 18, 2025, 12:09am UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/3 "2025-07-18T00:09:30Z")

</div>

So in your database, you have a list of quotes for Motto, Guilty pleasure, and Shortcoming, and the full space you’re consider is all those quotes, avoiding empty cells?

---

<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 18, 2025, 1:14am UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/4 "2025-07-18T01:14:04Z")

</div>

> [@Nicolas\_Joseph](#):
>
> - Store all values from these 3 columns in a single one thanks to a _Template_ column, just like this:
> 
> ![All 3 columns](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/0/00c8533aceb8c4675cfaf326a6d825a841c02a3f.png)
> 
> - Convert this _Template_ column into an array, using a _Split Text_:
> 
> ![All 3 columns in array](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/5/e502d798909db1a0204d05326776257023d4885b.png)

You can combine these two steps into a single step by using a Make Array column.

---

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 18, 2025, 11:16am UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/5 "2025-07-18T11:16:22Z")

</div>

Ho wow !  
This is more than I expected, thank you @Nicolas_Joseph

@ThinhDinh

This is my actual table :

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

and the goal :

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

It doesn’t matter if the same quote is showing several times.

---

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 21, 2025, 6:19pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/6 "2025-07-21T18:19:04Z")

</div>

How can I make this in the same table without the previous displayed part ? 🤔

---

<div class="post-metadata">

**Author:** ![Nicolas\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_joseph/32/76105_2.png) [@Nicolas\_Joseph](https://community.glideapps.com/u/Nicolas_Joseph)\
**Post date:** [July 21, 2025, 9:57pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/7 "2025-07-21T21:57:52Z")

</div>

Does your screenshot is from the **`Users`** table @Korbib?

If so, you just have to apply the steps from what is described preivously, moving all firsts steps about **`Quotes`** table directly inside the **`Users`** one 😉  
And of course, win one manipulation using tip provided by @Darren_Murphy!

In the layout, you can also use an action directly in the _Hint_ component. Same logic (action with _Set column value_) 👍  
 ![Hint component with action](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/0/50c2cc2fa08d4e4ab3d53c1afb4b8cf243e7ceab.png)

  

Where are you stuck, maybe we could help you from there?

---

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 22, 2025, 12:01pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/8 "2025-07-22T12:01:31Z")

</div>

I don’t use the users table, I’m on a free plan.

I don’t want to use the Hint component because I don’t want to have an action button.  
I know it’s a bit strange but my goal is to have a hidden feature 😅

---

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 22, 2025, 12:33pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/9 "2025-07-22T12:33:52Z")

</div>

In a previous app, I made it like this

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

Each component use a random single value for each column.

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

The problem is when the random hits an empty cell, the component dispear and sometimes there is no component because all 3 single value columns hit an empty cell.

That why I wanted to combine these 3 columns into one without empty cells

😅

---

<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 22, 2025, 1:30pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/10 "2025-07-22T13:30:49Z")

</div>

- Use a Make Array column, pointing to the 3 columns. So you have an array of values from 3 columns in each row.
- Use a Lookup column, point to the Make Array column above. Now you have an array of values from all 3 columns, for all rows.
- Add a Single Value column \> Random \> point to the Lookup column, and use it for your hint component.

---

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 22, 2025, 1:53pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/11 "2025-07-22T13:53:05Z")

</div>

thank you @ThinhDinh

But the make array column can’t be pointed in the lookup column 😕

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/9/7948285667784d4fe7df3258654075077ca4f651.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/8/f8a159ce93bd7b01f5c78787f3cbd64ab8833ebd.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 22, 2025, 2:08pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/12 "2025-07-22T14:08:56Z")

</div>

Ok so here’s plan B:

- Use a Joined List column, join the Make Array column using a comma as a delimiter (so you don’t have any empty elements here).
- Use another Joined List column, join the Joined List column above so you have a comma-delimited list of everything.
- Use a Split Text column, split the 2nd Joined List column by a comma so you have an array.
- Add a Single Value column \> Random \> point to the Split Text column, and use it for your hint component.

---

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 22, 2025, 4:32pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/13 "2025-07-22T16:32:19Z")

</div>

Thanx for the reply

That’s strange I can’t see the single value with the split text but if I make a single value with a simple column it works 🤔

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

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/3/133edfbbd28c016311eb8694e19c153bb365c701.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 22, 2025, 11:44pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/14 "2025-07-22T23:44:49Z")

</div>

I think your random all quotes column is setup incorrectly, as it shows an array in your case.

Here’s an example I just setup.

 ![CleanShot 2025-07-23 at 06.43.34](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/6/e62ccd4ecc6184f1c9a3927a2a9267331940994c.png)

 ![CleanShot 2025-07-23 at 06.44.16](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/7/97e735a12c51176adc66f4936f04fd5a7e8a0da2.png)

---

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 23, 2025, 11:50am UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/15 "2025-07-23T11:50:10Z")

</div>

Ho yeah !!! 🥳

You’re right, my random column didn’t point to the right split fonction 😅

Thank you, it works like I wanted 👌

---

<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 23, 2025, 11:20pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/16 "2025-07-23T23:20:19Z")

</div>

Great!!!

---

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 24, 2025, 12:45pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/17 "2025-07-24T12:45:55Z")

</div>

Too bad that the Hint component doesn’t allow markdown and we can’t hollow the action button 😕

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/3/730b07a1066f1a8293091b2b5f989c562d49c44e.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 24, 2025, 11:37pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/18 "2025-07-24T23:37:47Z")

</div>

If you want to style it better, either use inline styling HTML in a rich text component, or use the AI component..

---

<div class="post-metadata">

**Author:** ![Korbib](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/korbib/32/71813_2.png) [@Korbib](https://community.glideapps.com/u/Korbib)\
**Post date:** [July 25, 2025, 1:23pm UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/19 "2025-07-25T13:23:01Z")

</div>

Ho yes !  
First time I use AI component.

It’s better

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

Thanks a lot 🙏

---

<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 26, 2025, 1:02am UTC](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257/20 "2025-07-26T01:02:04Z")

</div>

Yes!!! That looks clean.

But I think you want your button in there as well?

Add an action to the component (e.g: shuffle) and prompt the component to run the shuffle action when the button is clicked.

[Next page](https://community.glideapps.com/t/showing-a-random-value-from-3-columns/83257.md?page=2)
