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?
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.
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.
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
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 )
Hope this helps