New 'Format as text' expression on lists

image

image

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

Oh, man. That’s such a cool update!


image

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?

Very useful for APIs

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

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!

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

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.

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

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 ..."
}

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:

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!

This feature is amazing!

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

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

Pretty damn awesome :pray: :robot:

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.