Forum Documentation Showcase Pricing Learn more

How Do I Assigning Values to a List of Text?

Hi there @neerja
Thanks for your reply.
This isn’t a feature request. This is a request for help.
Bubble has the ability to define a list of text.
My question is how do I use the set list operation to assign a list of text within a create new thing action?

Hey @antony, I’m assuming you figured this out, but any Thing with a list type on it has the set/add/remove/etc actions on it. So, when you create a new thing, you just target the field that is of type “list of whatever”. For example, here is a new thing that has a list of texts on it. Just set the list of texts:

Aside: There is almost NO scenario in which a list of texts is useful on a Thing as a field. I will bet you dollars to donuts that your “list of texts” is better defined as a list of Things (even if those Things have but one text field on them being a descriptor like “Name”).

Hey @keith, thanks for your input! Yes, “add”, “set list” etc are familiar to me… but if I want to “set list” a list of text, I cannot find the syntax to do that with. Do you know the answer to that?

So you then raise an interesting question… why use a list of text rather than a list of a thing with only a text field.

My main reason is simple: I don’t want the text to exist as a separate thing in the database, because:

  1. My system is for multiple subscribers who can themselves have multiple users, so nothing can exist in the database without also having an ownership field. I’m wanting to avoid that when storing simple information.

  2. I sense that a list of text is more rapidly processed than a list of things. I use lists of text to process large amounts of response data from a client questionnaire, and there are lots of posts on here about the speed benefits of doing that through text rather than things.

Being English, I’m not so familiar with your betting expression… but since I don’t eat donuts, I’ll have the dollars please! :slight_smile:

Best wishes,

Gotcha, @antony. So, do you mean, “How do I construct a list of texts?” (i.e., the right hand side of the equation?) I don’t fully understand the question, I guess. You either have a list of texts, or you do not.

Due to the limitations on iteration in Bubble, it can be difficult to create a list of any data type. Creating a list of things out of thin air in Bubble is difficult (sometimes impossible in vanilla).

Hey Keith, yes I want to construct a list of text.

In a create a new thing action I want to assign a list of text in a single statement, so to say:

My List of Text set list Apple, Pear, Banana

Except the above syntax doesn’t work so I’m looking for a syntax or method that does!

Hey @antony,

Well, if you have a single item that is of text data type, you can push that on to a list of texts. Do that over and over. (This is the difference between “add item” and “set list”, right?)

The list of texts needs to exist somewhere. It can be an empty list on a Thing (Thing’s field “List of Texts”) or, locally, a custom state (or Repeating Group or similar structure) of type text (“is List”).

Then you build your list, event-by-event, and then at some point save it (by writing it to the database with “set list”).

You need not create a list of texts with “slots” to contain the texts. The list will be created as you push (single) text items on to the list of texts.

This is what I mean when I say, “You either have a list of texts or you do not.”

Does that help?

Best Regards,

This topic was automatically closed after 70 days. New replies are no longer allowed.