History
I found bubble around the beginning of June when I was searching for an OTS solution for a specialized eCommerce shop. It seemed easy to learn, easy to use if I was willing to give up portability and depend upon a single source provider.
I am more than 7 weeks into this “little” project and have spent the last 3 weeks working through a single problem. Although Bubble really shines in fast UI/UX for simple applications, the lack of the basic logic control structure frustrates me. For/next, Do/While, For/Each and basic recursion. In my case the fatal flaw is recursion. I spend most of my time researching work-arounds on how to do ordinarily simple things so they will work in Bubble.
Scenario
We rent furniture and houseware products in packages. Our product catalog consists of packages AKA kits, bundles or assemblies. A furniture package contains a living room package, a dining room packages and (n) bedroom packages. The contents of each package varies based upon the selected style, number of bedrooms and number of bathrooms. There are 2,992 possible variations of products. I opted for a parent/child structure that limits this to 67 base products and only 3 visible to customers.
Solution
I set up a backend workflow that accepts an order, a product and quantity as parameters. The workflow adds an item to the Order Details thing, calculates discount and extended price then updates the Order with the result of the new Order Details that was created. The next step is to schedule the backend workflow to run recursively for each of the children (sub-products) of the current product. It works up to this point.
Problem
In the backend workflow the order detail items are added to the database. In my test case that is 27 items. However, only 9-15 items are ever added to the parent Order’s Order Detail list element. It isn’t consistent but it always seems the first 1 or 2 levels of recursion get added but semi randomly level 3 and 4 Order Details are not added to the parent group. I can see the order details in the App Data when I display the table, they are just missing from the Order’s detail list.
If I watch the RG during the execution of the workflow, I can see the items being added. Some of the missing items are added then replaced by a different item. No errors appear in the log.
Alternatives
The alternative solutions I see are to write my own API backend to do the heavy lifting and host it somewhere else and then use data API calls back to bubble to access the data (silly) or find a way to use the Run Javascript plugin, and write the code in JS. However, I can’t find any documentation on how to retrieve/update bubble data within the Run Javascript. The only information I have found relates to passing parameters and returning values. I would need to accept parameters, Create Order Details and Update Orders within the Javascript.
The Ask
I hate to throw away weeks of productive work but I cannot keep throwing time down a black hole. Does anyone have any solution they can offer to save this from being a massive waste of time and money?