Concatenate list with javascript

Hi Bubblers!

Just trying to concatene a list I get from a ‘do a search for’ with javascript (seems the most legit to do it), but I run into an issue, my code is not working and I can’t get why…

I try to return it to a state (that is defined in my app) and it doesn’t work. Actually, it’s not even showing in the console, but I know that the list is not empty and well found by bubble when running in debug mode.

Any thoughts?

Thanks a lot!
Have a good day :heart_eyes:

Why don’t you just use Bubble’s standard functionality for this, instead of custom JavaScript?

What exactly do you need it for?

1 Like

Hi Adam,

Thanks for answering. Actually didn’t see a concatenate function on bubble, there is one?


In Bubble, the concatenate operator is called ‘Append’.

But, from what you’re describing, you want to use ‘Join with’ rather than ‘append’ (‘join with’ works on lists)

(although, depending on exactly what you’re doing, there may be no need to use any operator here, as Bubble automatically joins lists of texts with a comma when printing them as text - so it depends on what exactly you’re trying to do - if you need the texts joined with a specific character then you can use ‘Join with’. if a comma delimiter is fine then no need to use anything other than the expression. You can also use ‘format as’ on the list if you need more control over how to print each element from the list.)

1 Like

If this code will cause errors if the result is 0

Hi Adam,

Actually not trying to append, but to concatenate list values. Finally works with ‘format as text’, without any delimiter.

Thanks for your help!

1 Like