Bubble creates data item even when the condition is false

Hello

I have a workflow in which if a certain condition is true it should create a database item. The problem is it creates an item every time even when the condition is false. The only difference is that when the condition is false the created record is empty (so the condition works for the fields of the created thing but not for the creation itself). Anybody has any idea why is this happening?

can you share some screenshot or come on a call

You should share screenshots of your workflow and actions if you’d like help debugging, but the step-by-step debugger is good and will help you work it out yourself faster too.

I cant use debuggger unfortunately, because it’s a backend workflow.

Here’s the screenshot:

If result of 2 is empty, you’re creating a thing.

Then, you’re setting tthe sprzet to Result of step 2’s Parent. That means that the field you’re setting will always be empty.

So, I’ll bet that your condition is actually true and Step 2 is never created, which means step 3 will be created.

The condition is not “when result of 2 is empty” but “when result of 2’s sprzet single is empty” and most of the time it’s actually not true - i checked the created records of “nie dodano” in the database and the fact is that they are not always empty.

It looks like if the condition is working for setting the field “sprzet” but not for creating the item. It creates “nie dodano” every time but sets “sprzet” field only when the condition is true.

Oops, sorry I misread.

Have you checked the logs to understand what’s happening and why?

Yes, but unfortunately I cant see any valuable info.

Have you enabled all the log filters ? (The little checkboxes above the logs) They allow you to see more information

I didn’t know about that, thanks! But unfortunately in the problematic workflow logs nothing changed after enabling all the filters.

What is the condition on the step 2? Likely the thing that you want to create in step 2 is not getting created, so step 3 always creates the thing you want to create in step 3, and because step 2 didn’t create, the value for step 3 of sprzet coming from step 2 is empty.

Check privacy rules, we never know… I see the user is anonymous, so depending on what you set up for the SINGLE data type…

Maybe you can check “ignore privacy rules” for your API Workflow :slight_smile:

What I do for clearer “logs” is always have a table “admin logs” with fields :

  • label : what I m logging (wf creation of thing xy etc)
  • data : SINGLE IS EMPty : result of step is empty etc etc
  • dev : an option set with developers names so we can separate our logs(and scream at the one who never clean his logs and let 10k logs in the app :laughing:)
    Hope this helps