Forum Documentation Showcase Pricing Learn more

Connecting two Things


#1

Hello fellow Bubblers! I urgently need some help!!

So here is my scenario:

I have two data types:
Type 1 = Gigs
Type 2 = Offers

Data structure for offer:
image

One user will post a Gig and another will make an offer. I have a repeating list of all gigs. There is an offer button that shows a popup for the offerer to make an offer:

image

When the user makes an offer, there is a workflow to create a new offer, send the gig creator an email, and change the status of the related gig.

The workflow creates a new Offer in the offer data type, however, I am struggling to get the unique ID for the current cell. I also do not get emails or get the gig to update because of the same reason. How do I pass the current cell info to the popup button’s workflow?


#2


#3

In case @JohnMark’s brief explanation (which is entirely correct) doesn’t make sense, here’s a video worth watching:


#4

Hello @keith and @JohnMark. First off thanks for the response!

I’m not trying to display data from the repeating group. I’m actually trying to pass value from the corresponding cell when creating a new offer. I’m not seeing any reference of the current cell in the workflow option. This is where I’m stuck.


#5

My video answers your question as well. Once you snag that Thing you can do with it what you will. If you can pass the selected Thing to a pop-up you can pass it to a workflow, see?


#6

@keith great video. I watched through it and got some useful insights but I think I’m still missing something. I can get as far as the fields for the parent thing but not to the cell’s value. It’s hard to wrap my head around the way Bubble goes about somethings that should be straightforward.

Your video is great working with a single thing type but in my case I have 2 type of things. It’s easy to create the Offer but getting the Gig’s cell value is what driving me crazy.


#7

How is it that you can’t select a Gig? Watch the video again from about 8 minutes or so. I show exactly how to get a Thing from the RG (in the video it is of type “Favorite Thing”, but for YOU, that’s your “Gig”) and operate on it in a popup. (And then I go on to show some fancier stuff.)

[Aside: Is your RG… perhaps… NOT full of Gigs? Is it… perhaps… full of UNIQUE ID’s OF GIGS? That’s where you are going wrong. An RG is an element for displaying Things. They can be used to display primitives, but this is not something that one will regularly do. You send the RG a list of THINGS. Not a Thing’s something (like, say, Thing’s unique ID). You send it the Thing itself. And then, the elements WITHIN the cell of the RG are used to show various aspects (properties) of the Thing.

If you do not start with an RG that contains Things, what I show in the video WILL NEVER WORK. This is supposed to be obvious from my video and I do not dwell on this point, but one reason I made this video and start from scratch is that it’s easier [and probably nicer] to simply show how its done and let people come to their own “oh, I’m a goofball” moments, as opposed to me screaming at the viewer. ]

Now, my example popup is going to delete the Favorite Thing. But for you, the user is going to make an Offer on the Gig. Same damn thing. These scenarios are only different in terms of what you do after the user clicks “OK” (for you, “Make Offer”).

Your button says “MAKE OFFER”. And, in fact, that’s EXACTLY what your workflow is going to do: You are going to Make (Create) a New Offer! It’s that simple.

So do that. Caveat:

Now, there IS a huge – HUGE – UUUUUUGE – problem with your Offer data type. (Which I hope you have now already realized.)

I see that it thinks that a Gig is a text. That is NOT CORRECT. A Gig is a Gig. The Gig field on your Offer should be of type Gig.

When you create this new offer, DO NOT try to populate the Gig field with a text. (I know what you’re thinking: “I need to store the Gig’s unique ID.” WRONG. You need to store the Gig itself. So do that.)

Secondarily, there’s another problem: It seems to me that your data model is Gig-centric and that, in fact, an Offer doesn’t need a Gig field. A Gig needs an field that should contain a LIST of Offers. Instead of populating a Gig field on Offer, you should consider creating an Offer and then (step 2 in your workflow) attach that Offer to the Gig’s list of Offers.

In this case, Gigs should have a field of type OfferS (note plural). That field should be of type Offer, but it should ALSO be a list (check the list box).

So after creating the Offer, you Make Changes to the Gig (what Gig? this popup’s Gig). The field you change would be “Offers”. That field is a LIST, so you ADD the Offer to the list of Offers. (You’ll see this in the Make Changes dialog.) The Offer you will add is “Results of Step 1”, which will be the Offer object your workflow just created.


#8

@keith. Thanks again. Totally makes sense. I will reconstruct my model and give it a shot. I appreciate the detailed guidance.


#9

@keith

List of Things in RG
image

Result
image

Popup Gig
image

Offer Button Workflow
Step 1 (OK)
image

Step 2 (Offers list still not updating in Gig)
image

Not sure what other options I have :frowning:


#10

Keep trying? You’re just doing something derpy somewhere. What you are attempting to do is not hard, is not advanced, and is not bugged.

But I feel your pain.

Share your editor, perhaps?


#11

Cool. Petty new to Bubble so that might be the case. How do I share the editor. Just make it public?


#12

@keith I shared it with you in private message. I really appreciate the help!


#13

Here’s your derp, @webward3: You are not sending the Gig to the popup. You are simply showing the popup. Here’s what you add:

Aside: The entire video I pointed you to is ALL ABOUT this idea/issue of sending a thing to a popup so that it can be operated on. I’m not sure how you missed this point.

Additionally: When you are building functionality of any type, but particularly functionality like this where you are sending some data somewhere, but its entirely invisible (as data has a tendency to be), don’t be afraid to VISUALIZE it.

Your error would have been obvious if your “make offer” popup had a simple text element on it that reported to you the popup’s Gig. (This would probably be a sensible UI thing to add as well. When the user clicks “Make Offer”, the popup that appears gives no feedback as to which Gig the user is making an offer on. You might consider having that popup display something like:

run mode:

In fact, you can even design things such that your /version-test site shows debug info, but /version-live will not. Like this:

Hope that helps.


#14

@keith you are a hero! REALLY appreciate you. I made a rookie mistake :).