# Variable Choice list

**URL:** https://community.glideapps.com/t/variable-choice-list/22578
**Category:** Ask for Help
**Created:** [February 10, 2021, 7:18pm UTC](https://community.glideapps.com/t/variable-choice-list/22578 "2021-02-10T19:18:42Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 7:18pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/1 "2021-02-10T19:18:42Z")

</div>

I am trying to figure out how to make a list that contains a list of a set of items but I want to turn certain items off for varying conditions. What I have is a boat booking application. People book a certain type of boat say B1, B2, B3, B4 for a time during the day. There is a limit of each type of boat ( eg 4 boats of type B1, 5 of B2, 3 of B3, 10 of B4). The time slots are fixed but can overlap with each other. As boats get booked I can figure out the number of boats left for each time slot already but when a boat count goes to zero I can not figure out how to take the boat out of the list. For example, if there are no bookings the list would show B1, B2, B3, B4. Once bookings started happening then say there were no boat type B3 left I want the list of boats to be B1, B2, B4.

---

<div class="post-metadata">

### Author: ![Mishta\_P](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mishta_p/32/16900_2.png) [@Mishta\_P](https://community.glideapps.com/u/Mishta_P)
#### Post date: [February 10, 2021, 7:20pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/2 "2021-02-10T19:20:51Z")

</div>

You can filter the drop down list. You should be able to add a filter when boats available \< 1.

On the list, go to Features. And filter should be there for you.

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 7:34pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/3 "2021-02-10T19:34:21Z")

</div>

Yes that works if I have a column of boat names beside a column of boat counts but there are several booking times in a day and so the boat count is varies (or can vary) for each time slot depending on what boats are booked for when.

---

<div class="post-metadata">

### Author: ![belzoni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/belzoni/32/20862_2.png) [@belzoni](https://community.glideapps.com/u/belzoni)
#### Post date: [February 10, 2021, 7:42pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/4 "2021-02-10T19:42:13Z")

</div>

I’ve got something that sounds similar and may have a solution. Can you post a screen shot of the list or share a Sheet?

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 8:08pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/5 "2021-02-10T20:08:31Z")

</div>

Will try with some screenshots first.  
In one tab (Book) in my sheets file I have this (some columns hidden)

 ![book](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/7/774dec67e5e2857ec91169c263095d2039109077.jpeg)

In another tab (Data) I have

 ![book](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/7/774dec67e5e2857ec91169c263095d2039109077.jpeg)

In the app I can book a boat off this screen - corresponding to a row in the Data tab  
 ![book2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/4/b4b42f4bbdc33e7a7793fcdd7a992798131a81e0.jpeg)

Which currently gives me a boat choice from the Data tab  
 ![list](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/7/572da7cc0be380aca9dd5d9816614c670f31d8e2.jpeg)

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 8:09pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/6 "2021-02-10T20:09:50Z")

</div>

What I want to do is… based on the value in Column C-Lion thru Private if the value is zero I want to remove it from the list

---

<div class="post-metadata">

### Author: ![belzoni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/belzoni/32/20862_2.png) [@belzoni](https://community.glideapps.com/u/belzoni)
#### Post date: [February 10, 2021, 8:18pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/7 "2021-02-10T20:18:49Z")

</div>

Your first two screen shots are the same. I think you meant to upload a different image for the DATA tab.

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 8:20pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/8 "2021-02-10T20:20:51Z")

</div>

Data tab

![names](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/8/c8310202b6c68270b5b105854c34237a2b0ea8a5.jpeg)

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 8:21pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/9 "2021-02-10T20:21:35Z")

</div>

BTW sorry about that and thanks for the interest

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 9:04pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/10 "2021-02-10T21:04:15Z")

</div>

This would be trivial if I could get a choice list to be gebnerated from a cell that contained a delimited list of values (comma separated)

---

<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: [February 10, 2021, 9:18pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/11 "2021-02-10T21:18:55Z")

</div>

Really, you could sort of generate a choice list from a delimited list. You can always filter a choice list, but since you have a pretty static list of choice values, and if you already have a way to build a delimited list, then you can take the delimited list, create a Split Text column, which will turn it into an array, then create a relation column to link that array to the sheet that contains all your possible choices. Finally, you can point your choice component to the relation column. In that way, you can ultimately drive list of possible choices from a delimited list in a single cell. As long as final outcome is a list of choices that are contained in rows, then it will work.

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 9:32pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/12 "2021-02-10T21:32:49Z")

</div>

That was my problem I did not know how to get the data into rows (an array) from columns.

So if I had separate columns with the names in them on each row (and I name them properly) can I merge that into an array using an array column and then point the choice list at that array column

---

<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: [February 10, 2021, 9:40pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/13 "2021-02-10T21:40:00Z")

</div>

Not exactly. A choice component can only be built from rows, but if you follow the steps I highlighted above, that array can drive a relation to a sheet that has the data in rows. That relation would directly drive the choices, but indirectly, the array would drive the relation.

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 9:50pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/14 "2021-02-10T21:50:34Z")

</div>

Yes, I tried it and the array column does not show up in the choice list options but if it had worked it would’ve been trivial. I will work a bit on the suggestion you gave me and if I can not figure it out will ask for more details.

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 10, 2021, 11:23pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/15 "2021-02-10T23:23:23Z")

</div>

Well I tried for a couple of hours to figure out what you meant Jeff. Here is what I did in the spreadsheet.

 ![spread](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/2/625514098d80433b60f33d53bbe13b2ed6141fdb.jpeg)

In the spread sheet each row is several bookings and on each row the type of boat available can change. the TEST column is the comma separated list to display in the Choice list

I can get this into the Glide data table where I split the delimited list  
 ![glide](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/2/c2ae7ca16e11327090bdd0be23a31f8130b94701.jpeg)

What I can not figure out is what you meant by “then create a relation column to link that array to the sheet that contains all your possible choices.”

---

<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: [February 10, 2021, 11:34pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/16 "2021-02-10T23:34:22Z")

</div>

I assume you have a sheet that lists each boat type? Let’s assume the sheet is called Boats. Create a new column type of Relation in the glide data editor. Set it up to link the boat types column you created to the boat type column in the Boats sheet. Then use that relation column for your choice component.

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 11, 2021, 5:15am UTC](https://community.glideapps.com/t/variable-choice-list/22578/17 "2021-02-11T05:15:15Z")

</div>

Okay. I got done what you described (I think). Here is what I did. The Boats tab is

![boats types sheet](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/7/375be1555ce1868bb86e2fdc9e7ea76238971cbd.jpeg)

To the glide sheet that tracks the bookings I added the relation column xxx

 ![Untitled](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/1/f14e97565b2752d31d6089b72b1521fb07c4ee83.jpeg)

Where sheet12 is the Boat sheet above  
 ![relation column](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/d/cd07acc6b7275f9a28576c13717db35ee8653ea4.jpeg)

Now when I go to the choice widget the column xxx does not show up in the Choice List \> Values selection.  
But I know the relation is done correctly because if I use a Inline List or a Relation List and pick xxx the proper data is displayed. The issue is that choice list does not allow us to use a relation to “load” its values.

---

<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: [February 11, 2021, 6:05am UTC](https://community.glideapps.com/t/variable-choice-list/22578/18 "2021-02-11T06:05:43Z")

</div>

You shouldn’t be looking for the relation under Values. You should look for it under Sheet. You want to set the relation as the source for you choice component. The values will come from the Boats column in Sheet12, but through the relation.

---

<div class="post-metadata">

### Author: ![Gary\_Biagioni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_biagioni/32/4201_2.png) [@Gary\_Biagioni](https://community.glideapps.com/u/Gary_Biagioni)
#### Post date: [February 11, 2021, 1:24pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/19 "2021-02-11T13:24:48Z")

</div>

Marvelous. Jeff thank you so much.

I did find out that I can use a Rollup column (at least I think that is what it is called when you name column all the same except for a digit at the end) in the glide sheet to generate the boat names to use in the relation which makes it a lot easier than generating a Comma separated list. The expression in the spreadsheet are much simpler.

Something I never foresaw was that using a choice widget if you take the value out of the choice widget values then it can not display the one you took out. So in the case where I run out a boat type - for the people that have booked that type of boat the choice widget no longer displays the value and they think oh no I do not have a boat. So now I have to have a component that displays what they currently booked and put the choice widget below it. If I find a better solution I will come back here and let you know.

---

<div class="post-metadata">

### Author: ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)
#### Post date: [January 17, 2024, 4:53pm UTC](https://community.glideapps.com/t/variable-choice-list/22578/20 "2024-01-17T16:53:27Z")

</div>


