Choice items from split text items

Hi,

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

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.

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?

1 Like

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?

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?

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

No, they are generated dynamically using an API call,

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.

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

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

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

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

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

Thanks, will try and find a solution around it

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

2 Likes

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

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

  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

  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.

I hope it helps you!

Saludos

4 Likes

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

2 Likes

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. :raised_hands:

2 Likes

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