Forum Academy Marketplace Showcase Pricing Features

Draggable UI elements

Trying to make Sum formula for a drop area, so when i drop a shirt in it, it says like $6.99 then if i add socks it’ll say $8.99, like a running total. I’m new to bubble so any help would be wonderful. Thanks!

A few ways you can do this… here’s one:

Set a custom state that is a number. Whenever a Product thing is dropped to it, add the value of that product to the state, creating your running total.

For example:

Let’s say the state is on Drop Zone A (element) and the state is called Total. And the Product Thing has a number field called Value.

When a drop zone has a group dropped on it > set state: “Drop Zone A’s total + dragged group Product’s Value”.

(I can’t confirm the exact element names for dragged groups for your workflows, but it should be obvious… if you’re having trouble… I’ll come back and edit when I’m not on mobile)

Then have a text element to display the total: dynamic text would be “Drop Zone A’s total”. So every time something gets dropped into it, it adds to the custom state value, and the text element displays that value.


Gaby | Coaching Bubble

1 Like

It would be awesome to see this demoed. I have been trying for a couple hours to make it work. I can get ONE draggable to display a total or value but cant get it to add or increment etc.

Here’s a basic demo:

Editor - https://bubble.io/page?type=page&name=drop_and_add&id=forumapp3&tab=tabs-1
Preview - https://forumapp3.bubbleapps.io/version-test/drop_and_add?debug_mode=true

2 Likes

And there it is AWESOME!

1 Like