I feel like there’s something missing in my understanding of component events.
I have a card, made into a component. On a button click there’s an event being triggered.
The event has a workflow “on_event” on the parent outside the component. This is all fine.
What I was trying to achieve is the following.
OnClick, before sending the event, I want the component do to some work and send a payload with the event (using event value).
I don’t seem to get where I can access that payload within the event workflow ??
Yes thank you. I watched all those articles and videos and it doesn’t cover the event payload. Just the event triggering.
But I did figure out how it works. I had to use the console log to catch the payload and understand the structure in order to catch and cast it properly on the event “triggered” side of things.
The problem is that you can’t see what the payload is live during execution. Since you can’t put a debug breakpoint in workflows, you can never catch the “event triggered” and look at what’s happening.
As you can see here, the ‘Event’ is always undefined.
Also, for the ‘event’ variable to appear in the bottom browser, you have to execute your event trigger at least once.
You need to define the event (trigger schema) in the settings. The events are usually not available like this , because the event has’t happened yet. So I think you might just want to log the empty event and attempt to trigger it in order to see the payload.
I found that the Event value doesn’t overwrite the default Event Schema. It seems that we cannot pass a payload based on a variable, just don’t know exactly if it is a current limitation or a bug.
You’re overcomplicating it and using not standard. Schema is just informative, it’s a helper to give you a hint of the data structure, the result once the action is run is the real data.
As mentioned by Broberto, the event is only informative. The binding UI is just an informative template. If you log the event value, you will see the correct results.
Hi @danlopes I just tested it and the event value returns the proper value from the trigger.
My complainants were because I thought the value would be the default event schema that was showing on my workflow, instead of the actual value returned from the trigger.
I think it would be great if the event data could dynamically update as the developer uses it, just like the proper workflow history that we may visualize the variables value used in the execution.