Ha, point taken, @zelus_pudding. Thereâs even more fundamental issues to solve than those you mention (though the bottom up RG one would be trivial for them to add even if they didnât make changes to the expression builder. (BTW, for anyone who wants to do that, one great solution is to use Floppyâs âRAM Listâ feature â Floppy has actions that allow you to insert an item or items at any position in a list.)
For my part, just adding a :map operator would fix all the stupid stuff people have to do just to iterate over a list. Bubble expressions are an array-oriented language. Give us the missing array features, at least just this one!
I seriously canât believe that to this day this hasnât been added. (As Iâve recently pointed out elsewhere: The interface for it is already there in the :filter dialog and an expression field for the map could in fact be added right there. Nobody can tell me this is more than an afternoonâs work and it would not add any significant code to run.js. The code for :filter would just change from a .filter() to a .reduce()) Now thatâs a force multiplier for sure. I built many of the features of List Shifter mostly to simply point out the missing pieces. And I was relatively confident Bubble would just swoop in and fix that stuff⌠But years later, here we are.
(All of the data stuff is quite easy and I donât understand why it doesnât get more love. There are 241 instances of .forEach()
in run.js and 471 instances of .map()
. @josh, ask your engineers if they can live without these array methods. Yet you withhold them from Bubble programmers â the expression builder needs these, too. WITAF, as I like to say. People do all sorts of just stupid stupid stuff to work around this. Hours and hours of pointless time, not to mention server capacity [because one of the default solutions is to do recursive workflows in the backend over some list⌠which is just dumb dumb dumb for simple math, etc.])
A slightly harder thing for Bubble to fix, but that would be a huge force multiplier is to make it possible for client-side actions to return values to the workflow. This would let us easily and efficiently add a bajillion different fixes/cool features ourselves.
Also, a means of supporting client-side objects that are not Things but have properties that can be accessed in the expression builder. This would unlock huge potential.
I donât begrudge Bubble having an R&D budget and investing in ideas that move the no-code space forward. But like you I wish they would, at the same time, do some of the very very basic things that would power up Bubble 100X.
To keep this at least a bit about AI: Even GPT-4 knows that the iteration thing (the lack of any on the client side) in Bubble is stupid. Check this out:
ME: How can I add 1 to every item in a numeric list in Bubble (the visual web development platform)?
GPT4: Bubble is a visual web development platform that allows you to build web applications without writing code. While Bubble is more focused on building web apps rather than data manipulation like adding 1 to every item in a list, you can still achieve this using some workarounds.
Hereâs a step-by-step guide to add 1 to every item in a numeric list in Bubble:
- Create a new Bubble app or open an existing one.
- Go to the âDataâ tab and create a new data type called âNumberItemâ with a field named âvalueâ of type ânumberâ.
- Go back to the âDesignâ tab, and add a Repeating Group element to your page. This will be used to display your numeric list.
- Set the Repeating Groupâs âType of contentâ to âNumberItemâ and its âData sourceâ to âSearch for NumberItemsâ.
- Add a text element inside the first cell of the Repeating Group and set its âTextâ to âCurrent cellâs NumberItemâs valueâ.
- Create a workflow to populate your list with the initial numeric values. You can use the âApp dataâ tab to add NumberItem entries manually or use an API, file upload, or another method to import the data.
- Add a button to your page and label it âAdd 1 to listâ.
- Create a new custom event in the workflow tab, name it âAddOneToListâ, and set its âEvent data typeâ to âNumberItemâ.
- In the âAddOneToListâ custom event, add the action âMake changes to a thingâ, select âEvent thingâ as the item to change, and set the value of âvalueâ field to âThis NumberItemâs value + 1â.
- Go back to the workflow for the âAdd 1 to listâ button, and add a âSchedule API Workflow on a listâ action.
- Set the âList to run onâ as âSearch for NumberItemsâ (or the same data source as the Repeating Group) and select the âAddOneToListâ custom event as the workflow to run.
- Preview your app, populate your numeric list (if not done already), and click the âAdd 1 to listâ button. The Repeating Group should update with each number increased by 1.
This is one way to add 1 to every item in a numeric list in Bubble using Bubbleâs native elements and workflows. You can also explore using plugins that provide more advanced list manipulation capabilities if needed.
ME: What plugins might those be?
Bubble has a variety of plugins that can help you with list manipulation and processing. Here are a few you might find useful for working with numeric lists:
- List Shifter: This plugin provides advanced list processing capabilities, including mapping, filtering, and reducing lists. Using List Shifter, you can create a mapping function to add 1 to each item in the list.
- Toolbox: The Toolbox plugin includes several utility elements for Bubble, including the ability to run JavaScript code. You can use the âRun JavaScriptâ action in a workflow to modify your list, leveraging JavaScriptâs array manipulation methods to add 1 to each item in your numeric list.
- RepeatingGroup Tools: This plugin offers additional functionality for Repeating Groups, such as the ability to extract data from a Repeating Group as a list. While it doesnât provide direct list manipulation features, it can be helpful when working with data in Repeating Groups.
BWAH-HA-HAAAA-HAAA-HAAA! I am laughing in pain.