# Choice items from split text items

**URL:** <https://community.glideapps.com/t/choice-items-from-split-text-items/41615>\
**Category:** Ask for Help\
**Created:** [May 4, 2022, 4:28pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615 "2022-05-04T16:28:15Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paresh\_Srivastava](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paresh_srivastava/32/33646_2.png) [@Paresh\_Srivastava](https://community.glideapps.com/u/Paresh_Srivastava)\
**Post date:** [May 4, 2022, 4:28pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/1 "2022-05-04T16:28:15Z")

</div>

Hi,

I am trying to find a solution to populate items in a choice component from the split text items.  
See the image below,

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

So, if a user enters a pincode, using some API calls and parsing JSON responses, I can create a list of locations using split text. I am stuck with being able to show these locations in a choice component for the user to select the location.

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

Looks like I am missing something as logically, it should be possible. There are days when a small challenge knocks the wits out of you, and you start learning Glide all over again!!! Any Help?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [May 4, 2022, 4:33pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/2 "2022-05-04T16:33:37Z")

</div>

create a vertical list from that split using the if-else column… (I assume you have these locations in some column)  
how you are getting locations?

---

<div class="post-metadata">

**Author:** ![Paresh\_Srivastava](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paresh_srivastava/32/33646_2.png) [@Paresh\_Srivastava](https://community.glideapps.com/u/Paresh_Srivastava)\
**Post date:** [May 4, 2022, 4:38pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/3 "2022-05-04T16:38:32Z")

</div>

Thanks @Uzo for the quick revert. These locations are generated dynamically based on the pincode entered in a text field. Can you guide me on the method to create a vertical list using if-else column?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [May 4, 2022, 4:39pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/4 "2022-05-04T16:39:12Z")

</div>

Do you have a list of locations somewhere? how do you assign Pincode to the location?

---

<div class="post-metadata">

**Author:** ![Paresh\_Srivastava](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paresh_srivastava/32/33646_2.png) [@Paresh\_Srivastava](https://community.glideapps.com/u/Paresh_Srivastava)\
**Post date:** [May 4, 2022, 4:46pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/5 "2022-05-04T16:46:26Z")

</div>

No, they are generated dynamically using an API call,

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

In the screen above, I am collecting the pincode from the user in a text filed and store it in a user column. Next, I use google maps API to generate a list of locations around that pincode. I use a template column to clean up the list of locations and use split text column to store the locations as separate items.

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

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [May 4, 2022, 4:50pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/6 "2022-05-04T16:50:23Z")

</div>

then you cant convert to vertical… unless is a fixed number of locations that you wanna show… then you can create that many columns and pick the corresponding text

---

<div class="post-metadata">

**Author:** ![Paresh\_Srivastava](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paresh_srivastava/32/33646_2.png) [@Paresh\_Srivastava](https://community.glideapps.com/u/Paresh_Srivastava)\
**Post date:** [May 4, 2022, 4:53pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/7 "2022-05-04T16:53:17Z")

</div>

True, I guessed the same since the count of locations will be different for different pincodes.

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [May 4, 2022, 4:54pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/8 "2022-05-04T16:54:25Z")

</div>

you can do that in google sheets, in glide you would have to create rows and use a content generator… is possible

---

<div class="post-metadata">

**Author:** ![Paresh\_Srivastava](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paresh_srivastava/32/33646_2.png) [@Paresh\_Srivastava](https://community.glideapps.com/u/Paresh_Srivastava)\
**Post date:** [May 4, 2022, 4:58pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/9 "2022-05-04T16:58:21Z")

</div>

Interesting, I am curious to learn more. Can you explain in detail?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [May 4, 2022, 4:59pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/10 "2022-05-04T16:59:39Z")

</div>

is similar to creating a row number in a glide table, you can try this method

> [@How do I create an auto-incrementing row number with Glide Tables?](https://community.glideapps.com/t/how-do-i-create-an-auto-incrementing-row-number-with-glide-tables/39572):
>
> This is a question that comes up a lot, so creating this topic to use as a reference. Typically, there are two distinct use cases when it comes to auto-incrementing row numbers. Use Case 1: – We need to generate a Part Number, or an Order Number, or an Employee ID. Once the number is generated, it should never change, even if rows are deleted. – The general approach for this use case is to maintain a static counter, use it to craft a suitably formatted ID, and increment it by one every time…

---

<div class="post-metadata">

**Author:** ![Paresh\_Srivastava](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paresh_srivastava/32/33646_2.png) [@Paresh\_Srivastava](https://community.glideapps.com/u/Paresh_Srivastava)\
**Post date:** [May 4, 2022, 5:28pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/11 "2022-05-04T17:28:32Z")

</div>

Thanks, will try and find a solution around it

---

<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:** [May 4, 2022, 5:31pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/12 "2022-05-04T17:31:12Z")

</div>

Ya, you have to create a working table that transposes your API results. This method will give you some ideas:

> [@fishbaguette\_breadbasket Transpose Columns to an Inline List: The Miracle Method](https://community.glideapps.com/t/transpose-columns-to-an-inline-list-the-miracle-method/32766):
>
> I’m often asked how to take columns of data (say form responses) and display them in an inline list. Here’s one way to do it—the MIRACLE METHOD. [[Glide: Transpose Data Columns into an Inline List with the MIRACLE METHOD] ](https://www.youtube.com/watch?v=t-sh_Q3WbQc)

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [May 4, 2022, 7:12pm UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/13 "2022-05-04T19:12:50Z")

</div>

Hola @Paresh_Srivastava  
What you need is something like this so that your choice component can use the _Name as Option_ column in its _Values_ parameter:

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

Here my step-by-step guide if you want to use it:

1. This is my _Param_ table where I have my results as a List and as an Array (similar to what you have)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/f/3f69b2890616aef79ff44a6ebb79850f1da00965.png)

2. In a new table (maybe?), create a new index column (e.g. IDX) with values from 0 to N. If your API returns always 8-11 locations so, create 14-15 rows with a valid numeric sequence as plan B

3. Create a Single Value column to bring my _Name Array_ column from _Param_ table in order to select array items at any moment.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/7/d7fe7a83cc0f2eb07635b64a3c3ca2dbcd8ed025.png)

4. Finally, create another Single Value column to choose the array item (_Name_) dynamically based on _IDX_ value  

Now, your choice component can use _Name as Option_ column as a valid parameter and you have what you wished.

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

I hope it helps you!

Saludos

---

<div class="post-metadata">

**Author:** ![Paresh\_Srivastava](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paresh_srivastava/32/33646_2.png) [@Paresh\_Srivastava](https://community.glideapps.com/u/Paresh_Srivastava)\
**Post date:** [May 5, 2022, 9:34am UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/14 "2022-05-05T09:34:40Z")

</div>

Hola @gvalero  
Thank you so much, your solution worked like a charm!  
Gracias

---

<div class="post-metadata">

**Author:** ![Paresh\_Srivastava](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paresh_srivastava/32/33646_2.png) [@Paresh\_Srivastava](https://community.glideapps.com/u/Paresh_Srivastava)\
**Post date:** [May 5, 2022, 9:39am UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/15 "2022-05-05T09:39:54Z")

</div>

Thanks @Robert_Petitto ,  
This is of immense help!  
I Have been a huge fan of your expertise on glide and have learnt a lot from your videos and really appreciate the time taken to explain the same in such clarity and detail. 🙌

---

<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:** [May 6, 2022, 9:40am UTC](https://community.glideapps.com/t/choice-items-from-split-text-items/41615/16 "2022-05-06T09:40:47Z")

</div>

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