I have a component that has a workflow that updates the data that I’m using in a few places within the component and works perfectly.
I have another component that works in tandem with it in a few places but this second component doesn’t always rely on the first one.
I added a workflow on the second component to trigger the update data on the first one but when I access the second component from a place that doesn’t have the first component the component action resets back to nothing. Is there a way around this?
Further looking into this it seems that it only works for that 1 instance of the component, which technically makes sense. Wondering how we trigger the correct component if we use the first component multiple times on the same page where it’d technically be visible in multiple places?
Adding on to this, so haven’t tried this from the second component workflow but I created a global workflow and have added multiple execute components for each instance which seems to work, just have to find a way to identify which one is the correct component to action on.
Does weweb have any OOTB solutions for identifying different instances of the same component or I just have to figure a custom solution.
If anyones trying to figure out how to do something like this until weweb allow for multiple instances of a component on the same page to be easily verifiable. The solution I came up with is the first component has a property that is unique to each instance of that component.
The second component already has a global workflow we use when we open it so I added a new parameter to the workflow that updates a global variable since we’ll only ever have 1 instance of the second component open at a time the global variable is technically tied to the once instance that is open (you could bind this to the second components property if you want). So now I have a global variable that technically knows what instance of the second component is open.
I then have a global workflow. It takes a parameter in this case it’ll be the global variable, that then has a multi branch workflow to determine what component action to execute since each one can only be attributed to one instance of the component. It’s a bit messy and complicated but it does work, there might be a better way but considering how many different places and situations where we’ll use this component and want to trigger the workflow to refresh the correct component, this solution fits for now.
This still probably won’t work if you’re looking to target a certain dynamic element in a repeated list to refresh one repeated elements data but you can refresh the full list.