I’ve setup a number of actions in a workflow to prevent a duplicate record from being entered based on three fields. However, for some reason it does not seem to work.
Here’s how it goes:
Note: Please disregard Step 1 and 2 (They both work perfectly fine)
Step 3 (Doesn’t work) - Show Message/Alert - Show “Must not post duplicate user services” if an existing record of User Service is found based on three fields (User ID, Service Category, Service Type)
Step 4 (Doesn’t work) - Terminate this workflow - Terminate this workflow if an existing record of User Service is found based on three fields (User ID, Service Category, Service Type)
Step 5 (This works) - Create a new record - Create a new User Service if an existing record of User Service IS NOT found based on three fields (User ID, Service Category, Service Type)
Hi there, @arsedian.ivan… I could be way off base here, but having :first item in those expressions doesn’t seem right to me. Instead of :first item is not empty, have you tried :count > 0? I’m not sure if that’s the issue, but it can’t hurt to give it a shot.
Best…
Mike
Edit: oh, wait… I guess you do need :first item if you are using is not empty. I just always go with :count.
I am also facing the same problem. I can see in the step-by-step debbuger that the “terminate this workflow” works (condition is true), but the next step (“create a new thing”) is also executed, as I can see that new thing in the database, although the step-by-step didn’t show that. Is that a Bubble bug?
A couple of years later, I’m guessing OP was running into a workflow execution (order of operations) issue, and this Bubble quick tip contains important information I wish I had known when I started using Bubble many years ago.
I decided to break this up at the top level rather than within the steps.
So, essentially, I have multiple ‘WHEN Button Next Step is Clicked’, and each one has its own unique ‘ONLY WHEN’ condition. Instead of having multiple steps each with an ‘ONLY WHEN’ condition.