A user enters unique information describing a Thing in a form and I need to either create this new Thing or find the matching Thing in the database and then use either the new Thing or the matched Thing for additional steps in a workflow.
In traditional programming I’d assign a variable in an if-else statement and then use that variable in the later steps of the workflow but I’m not sure how to achieve the same result in a Bubble workflow?
Perhaps it is worth clarify that what I’m really trying to avoid here is code duplication. I have the same workflow that I want run on a Thing I just couldn’t quite work out how to pass the Thing I wanted into that workflow.
It would be helpful if Bubble didn’t try to be so clever and ignore all the cool shit that’s built into JavaScript. In JavaScript, “boolean” operators don’t just return a boolean value – THEY RETURN THE VALUE THAT MADE THE OPERATOR COMPLETE.
So, in our case, all you want to do is get matched_thing OR create some new thing. In JavaScript we would just say:
matched_thing || function that creates some new thing