I am starting to notice that I could really do will globally accessible custom events in workflow, i.e. a set of events that can be accessed from any page’s workflow.
I am finding I am now repeating workflows because common functionality can be triggered from multiple locations/pages, e.g. Notifications etc.
I am thinking that in the Assign Folder, you could select a Global folder which can be seen anywhere in the app, and then in the trigger custom event you could ‘see’ those global events.
Also, on a similar theme, application level triggers would be good. e.g. Data event for the tables. Do When row added/deleted etc.
I just tried to do this, still doesn’t let me do what I want.
For example, I created a CustomCreateNotification event, it receives a CustomerOffer thing when an action is performed on the page, the workflow then creates a notification based on the content of the customer offer, and routes the notification also based on the content of the CustomerOffer.
Using the approach you suggest, if I put all this into a reusable element, and then place the re-usable element onto the page, I cannot trigger the custom event and pass in the CustomerOffer thing.
The only way I can see to do this using a reusable element, is to add more logic to process custom states, use customstate change triggers in the reusable element and set state workflows in the page, etc. adding complexity.
Unless I’m missing something here…
If the CustomEvent was available globally, it would be a simple case of TriggerCustomEvent and pass in the CustomerThing and everything would be hunky-dory…
Ok…All good! See it now…either a senior moment or a hiccup!
Maybe things where a bit out of whack with Slow Response from Bubble as it has been a bit hit and miss for a while when I was trying this first time. Had several “saving” timeouts and lost changes.
Can I just ask some follow-up questions to clarify…
So to create “global” app workflows, today you need to create a hidden reusable element and trigger a custom event on that element on every page you want the workflow to run?
I have a function that should change an [active] state to [not active] when an (argument [time] < current time) (the state is used on other pages for displaying products or not). SO, whenever/at all times, “a certain data field < current time”, the change should occur. As I understand the “do when”, it only applies when the particular page is loaded. Will that function trigger automatically as long as page is active?
If yes, what’s the difference between the reusable element method and copying/pasting the workflow on each page you need it?
I’d like to highlight this point. What’s most important is that it reduces the code size and limits the number of possible areas where you have to look when debugging. If you had copied and pasted a workflow on multiple pages, and had to make a change, you will have to maintain that change across multiple pages. Unless you document your work extensively, you will eventually forget to update a single workflow. Always reuse work whenever possible. You’ll thank yourself later.