Hi,
Might be a very basic question. How do I get a handle to a Thing in order to run the Modify Thing function in a Workflow?
I am having no trouble creating a thing in once case, but later, I want to go back and modify a thing when someone chooses to do that. I can’t figure out how to do a search for the Thing in the database table.
Table setup:
Table 1: Users
Table 2: Cancellation policies
Table 3: Transactions
Need to look through Table 2 and Table 3 to find Things that correspond with the logged in user. ie: The User will have a single Cancellation Policy I need to parse the table for and get a handle to so I can Modify Thing.
Thanks!
Assuming you’re not storing the cancelation policy on the User datatype, and don’t already have it it loaded on the page somewhere, you’ll need to do a search for the relevant cancelation policy.
But if a user can only have a single cancelation policy it might be just as easy to store that on the User.
True. Could be easier to store it in the user table, but I’ll face this same problem for transactions and each user will have many.
So I guess the trouble I’m having here is getting “do a search” to work.
I don’t seem to have a handle to the cancellation policy database. When I am working in the workflow, there’s no way to find it. Here’s a screenshot. This is the closest I could come. It’s talking about the result of a different part of the workflow. But that’s not what I want. I’m trying to get a handle straight to the database to do a search and I can’t. It doesn’t seem to be available. There’s some thing I’m doing wrong.
The first part of the workflow is working fine. It creates a new cancellation policy thing. Then the second tile of the workflow is supposed to look and see where the cancellation policies are that were created by the user that is logged in. But it’s not available. I don’t get it.
All that I can choose from in the screenshot of settings for the second tile in the workflow are results from number one, results from number two, or the user. There’s nothing else.
I’m not sure I understand…
Are you trying to change one thing or many things?
In any case you just need to do a search for the thing (things) you want to change.
Trying to find the correct Thing in the Refund Policy table by using “do a search for” and then Modify a Thing to make changes to it.
Looking to search by the email address of the logged in user to find the Thing that corresponds to them in the Refund policy table.
The problem is, I can’t seem to get a handle to the Refund Policy table to do this search.
I’m trying to get a handle to the table in the box I circled in red and it is not there. It only has 3 items to choose from: Results from Step 1 Results from Step 2 or User.
Presumably you’ve got a User field on the Refund Policy datatype (if not, you should have), so just search for refund policies who’s user is the current user.
But why do you need to search for it? And why do you need to change it? Is it not the same thing you’re creating in step 1?
Right. That’s exactly what I can’t do. I can’t search the other tables. I don’t have a handle to them. Do you know what a handle is from regular programming?
It’s like a pointer that points to something. And you use it to access that thing. I don’t have a handle to any table but the User table. So I can’t search through them.
I can’t seem to find any drop-down that lets me start searching through anything except the user table.
Where do I find access to these other tables from within the drop-down menus within the workflow?
But to answer your other question, sometimes people will change things. So yes. The first time it goes through the workflow , if someone has no Refund Policy it makes one. If they are going through the workflow but already have a refund policy, it edits it.
But I can’t get a handle to the refund policy table to search through it. Lost.
In Make changes to thing
action select Do a search for
and find those things you need to change. The following screenshot is just an example with types that I have in my system, replace fields and types with those of yours.
You’re thinking about this all wrong.
There are no ‘Handles’ in Bubble.
If you’re talking about database relationships (which you are), datatypes can (and should) refer directly to other datatypes.
The correct way to do this in Bubble is exactly what I’ve previously explained. If there’s a specific part of that you don’t understand then please elaborate on what you’re having difficulty with.
If you don’t understand what I’m talking about, then I suggest you take a step back and start from the beginning to get a grips on Bubble basics like relation data, accessing data, and creating and modifying things in the Bubble database.
The Bubble manual, and basic tutorials are the best place to start for things like this.
Thank you! It worked. This popup was throwing me off. It was getting me a little bit confused. So I picked some of the wrong things out of the drop-down based on it. What I didn’t understand is that I should set that for first item. The first item returned from the search. That’s why I was getting really confused. I kind of thought it would automatically just return the first item because there is only one item. I didn’t know I had to specify.
I think I’m good now. Thank you so much for the help. Much appreciated from both of you.
Just like it said in first sentence of the entire thread, I knew it would be something basic.
It’s working perfectly now. Thank you so much.
Yeap, I missed emphasizing that part as I get used to it. Though it may be confusing at the beginning, you’re not the only one, so don’t be worried. Glad you resolved it.
Good luck on this road!