I’m currently working on building a checkout process, and I’m running into an issue with managing the quantity of products in my repeating group. Here’s what I have so far:
- I have a repeating group that displays the products.
- Each product is selectable, and if it is, I save it to another repeating group.
- I’m also storing the quantity of the selected product into a element state in the current cell.
When clicking on the yellow button below, I’m using a scheduled API Workflow on a list to create new
order_items. I’m using a loop to repeat the process and create the right amount of
order_items based on the quantity.
However, the problem I’m facing is that I can’t send the correct quantity (iteration) to the scheduled API Workflow, since the value is stored in the element state of the RG. I’m not sure how to fix this issue.
Any guidance or suggestions on how to correctly pass the quantity to the scheduled API Workflow would be greatly appreciated. Thanks in advance for your help!
I could think of a few different ways to solve this.
Have you tried creating a thing in the database ‘checkout item’ and then just saving the values onto that? If the user leaves and comes back, it can still be in their cart that way too.
Does that help at all?
Thanks @j80231502 for the comment! That would definitely work. I like the beauty of handling it all on client side up to the point of clicking the button, in terms of speed and keeping the DB clean. (in case I understood you right)
Yeah, if you want to do it that way, there might be a way to use a plugin to access that information like this one: [New Plugin] bdk RepeatingGroup tools
Or doing some complicated list of numbers that match up with the list of items in the repeating group. You would need to be careful to make sure you adjust or delete the numbers that match with the record.
Or there might be another option…
I’ll have a look at the plugin, thanks! If somehow possible without a plugin would be amazing. Maybe someone knows a workaround
Ok, here is a really weird way to grab the numbers from your cart within an input inside of a repeating group.
Editor: testApp42wCleanDB | Bubble Editor
Does that help at all? It’s not using any plugins. This is not how I would do it, but I think it matches what you are trying to do. So there is nothing being saved in the database and then you can pass along the list of numbers to the backend.
Hey man, haha wow, that’s a crazy workaround! I really appreciate your effort! Thank you so much! I will try to implement it in my project today. I’ll let you know if I’m successful!