New 'Format as text' expression on lists

image

image

Reference here, but a little vague could do with a few more use cases please

15 Likes

Oh, man. Thatā€™s such a cool update!

1 Like


image

6 Likes

This is fantastic news. Generating text summaries of invoices used to be a major pain (e.g. trying to get ā€œQUANTITYx PRODUCTNAMEā€) displayed properly with each item on a new line.

To make sure, does the delimiter support ā€œline_breakā€ like the concatenation function does? Or can we just input a newline and it will work?

2 Likes

Very useful for APIs

1 Like

Yeah handy in generating a concatenated output of a data type and say using that data in an email for line items, the ability to keep looping with the ā€˜This [data type]ā€™ and keep working on the same item to generate the string is really useful.

image
image

2 Likes

This is incredibly powerful as it allows you to ā€œiterateā€ on each item in a list. I just used this to create a subtotal of a shopping cart I have in a RG [Take the RG list, for each, take quantity * price]. Previously, I was forced to use plugins to grab data within the RG.

Keep the list functionality comin!

1 Like

Wow, that is a great feature. Canā€™t believe Bubble was so quiet about this :sweat_smile:

Iā€™m building a plugin to issue fiscal invoices, and a major problem was to send an array of items into the JSON body. With this feature, itā€™s now solved!

Thank you for bringing this to light, @luke2

4 Likes

Agreed - @Bubble Iā€™ve used this about 50 times today for all sorts of thingsā€¦ Incredible feature. :slight_smile:

For whoever is still wondering this is awesome to reach out to an external API that requires you to build a JSON text body with a variable amount of items.

So letā€™s say they want you to send a name.
Youā€™d send this text:

{
    name: "Vini"
    }

By wrapping it like this

{
    name:  "Selected Humans's name"
}

But what if you want to send as many humans as there are in your database? You canā€™t type that statically.
So you use this feature and wrap it like this:

{
    name:  "This Humans's name"
}

So if you pass a list with three Humans, it will be like this:

{
    name:  "Vini"
},
{
    name:  "Renato"
},
{
    name:  "Luke"
},

Now you can safely pass as many Humans as you want.
Note that we already could do this, it was just tougher and often required plugins.
There are other use cases too, wrapping texts and building JSON bodies for external APIs is just one that has crossed my mind.

5 Likes

Whoa! This is huge! Amazing for sending data to an API but also opens a host of possibilities for calculations as well.

@nnich19, how we could have used this recently!

image

image

3 Likes

Easy HTML tables in emails
Dynamic CSS on pages
Export CSV Files with the CSV Creator plugin and include any calculated values that are possible to display in an RG

ā€¦ Just a few offhand uses for this.

@bubble should be making a big deal about this!

One thing is we still should JSON stringify text content that has special characters.

Not a valid JSON due to double quotes and new line:

{
 "first_name": "John",
 "last_name": "Connor",
 "description": "John Connor is a fictional major character in the "Terminator" franchise.
 Skynet ..."
}
1 Like

Hey folks ā€“ super glad to see that youā€™ve noticed this and are enjoying the feature! Weā€™ve kept it a bit quiet to make sure that we can address any bug reports promptly as they happen ā€“ a feature like this can be tricky to release! ā€“ so please do ping us if you see something unexpected. Otherwise, please enjoy! :smiley:

7 Likes

This is a truly great update.
Now, we donā€™t need to use or build custom plugins to achieve specific goals. So, it saves time.
But, as an additional operator, it would be great if you can provide JSON stringify:
image

In short, it helps to prepare HTML templates, JSON objects for the API connector, etc.

Thanks!

8 Likes

This feature is amazing!

Iā€™ve noticed a bug : if the delimiter is empty, itā€™s replaced by ā€œ, nullā€

1 Like

Incredible!! :confetti_ball: :sparkles: Huge thanks to the @Bubble team for this! Canā€™t wait to use it!

5 Likes

Pretty damn awesome :pray: :robot:

1 Like

What is the delimiter for a line break?

@luke2 Thank you so much for pointing this new feature out! I had to do some crazy workarounds using the List Item Expression plugin (or was that part of the Toolkit plugin?) and loads of JavaScript to get what I needed for my app, and now I can replace it all with something so simple and elegant and natively Bubble. Iā€™m over the moon right now. This was a desperately needed feature.

2 Likes