Forum Academy Marketplace Showcase Pricing Features

How to find highest number in comma-delimited list

Hi there,

I have a custom state that gets populated with a variety of numbers. The state may look like this:

5, 4, 8, 10, 1, 2, 22

How can I take this list from the state and quickly ascertain which number is the largest within the list?

Thanks!

Sort descending yes first item

1 Like

No “Sort” function is available.

If I create a text field to show the highest value, I choose the element’s custom state that has that comma-delimited list in it, but when doing so there is no sort function available to append.


1 Like

Thanks, I just realized when adding numbers to a List, that I cannot add the same number twice. So in creating a list of numbers that represent daily profit for each day of the month, I may need it to look like:

30.00, 40.00, 30.00, 50.00

but since Bubble won’t let me add duplicate items to a list it ends up looking like:

30.00, 40.00, 50.00

So I’m going to have to rethink how I approach this. I’m basically populating a chart with daily profits for any given month.

You could have a look into using regex to convert the comma separated list… not sure if it’ll work but worth a try.

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