Searching for make changes creates the thing?

I have a weird issue where i have a “Make changes to a thing”, which is a “do search for:first item”.

I want to th debugger step by step ensuring my database is empty of this type up to the point this make changes runs. The moment the step runs, bubble creates that thing. However it seems that this option is off.

Is this expected behaviour?

UPDATE: It seems there is no way I can prevent bubble from creating this thing, any search for that thing, creates it, it never returns empty.

I was hoping to return null and then use the not empty for the next step to create that thing, so i don’t have to do another “search for”, seems like a wasteful way to do this.

On your make changes to a thing action, you can add a condition Do a search for:count > 0

This ensures you’re only changing the thing if it exists.

It actually makes sense that it works this way, because you’re asking the system to change something that doesn’t exist yet :slight_smile:

1 Like

Are you sure that’s what’s happening?

It definitely shouldn’t be and I’ve never heard of that happening ever before.

And if it is, then what exactly is it creating? An empty database entry?

1 Like

Hello @jonah.deleseleuc and @adamhholmes, thank you for your responses. Well, it turns out the issue is even weirder than I thought it to be.

While doing a side by side for the video, I noticed that the entry is created before it even reaches the modify clause! I even deleted the “Only when” clause and it still creates the thing fully populated before the debugger reaches on this step (see photo attached).

I don’t have any relevant backend workflows, only for totally other things for sending emails, delete users, and retrieve dates. Nothing that works on the bookings or offers part of the database.

I checked all the elements above and bellow “Submit”, I don’t have any other workflows that could trigger together (even if they were, they should show on debug mode).

I tested also without totally empty database, but this is not the issue either.

The condition you’re using on the ‘Create a new thing’ must be wrong.

Share some screenshots of your full workflow setup, showing the exact searches and condition being used at every step (or better still, share a link to your editor).

Yes of course, here you go:

Submit is clicked

Make Changes to Offer…

Create new Offer…

Make changes to a list of Bookings

Trigger custom event (Navigation)

Pause for 1000ms

Set state to 1 (this is because i have 3 screens/steps, so i am reseting it to 1st screen basically)

Reset Data

The logic of the beginning of your workflow isn’t right. Creating an offer should come first, and there should be a condition it. The next step should also have a condition on it, but it shouldn’t depend on step 1. You should have a condition such as “if offer exists is no” on step 1 and “if offer exists is yes” on step 2.

The condition on your ‘Create a thing’ WF is ‘when result of step 1 is empty’.

Meaning when no item is found to modify the thing will be created.

So it’s doing exactly what you’ve set it up to do…

Is that not your intention?

(btw, the debugger isn’t helpful for seeing when WF steps run.)

1 Like

A privacy rule could be causing this.

For example if you can’t fetch any records; then it will always create something because there’s nothing to find.

Thank you everyone for your answers, turns out @adamhholmes is right.

If I delete the create workflow, this does not happen. I naively assumed that debugger stops the workflows and executes them step by step, which obviously as seen here is not the case.

@adamhholmes, yes works as expected, I just wanted to know this for future reference.

1 Like