What would be the most elegant solution to the following?.. On a page, I have a Reusable Element with a button. On the button click, I want to trigger a workflow with “maker changes to thing…” on the parent page.
To my knowledge, I can’t access the RE button from the parent page. Also, it’s not possible to detect if a variable has changed (only an input field) to trigger an action.
(I could create a new workflow within the RE, but I would like to avoid another DB search)
Any ideas?
P.S. Apparently, the answer to the topic question - it’s not possible.
I’m unsure if this helps, as you mentioned you would prefer to avoid creating a workflow from within the reusable element.
However, have you considered creating a custom event workflow from the reusable element? You can pass any type of data through to the reusable element from the page, so perhaps you wouldn’t need to do a DB search in this case? You can trigger the custom event from a workflow action on the page.
Yeh, that could work if only my case was that simple (I had to simplify it for clarity). The thing is, RE state can contain different values and I don’t know them upfront. I could set a “flag” state for any value being set, but it could only be set once. If user changes the value within the RE, the “flag” state won’t know it
Thanks for the idea… Unfortunately, RE can’t access custom workflows of the parent page I could create a custom workflow within the RE to be later used from the main page, but it’s a lot of work at this point in time. Also, this workflow is global (used by various elements), and putting it in just within this RE would be strange
P.S. Also, RE can’t access custom workflows from other RE either.
All right, problem solved. I went your way (sort of)… I still had to do the changes to the DB from within the RE. However, I didn’t have to do the search - just pass the current data point from main page to the RE.
For some reason I though I would need to do a remapping between the main page custom state and equal RE custom state (like, do a search where id = id)… However, once the custom state from main page has been passed to the RE, it finds the data points easily.
Also, just as you advised, I put the data writing into a Custom Flow, so it can be now accessed from the main page too.