Accessing payload of Component event

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 ??

1 Like

Great question!

Could you give more details on the part you mentioned- the component do to some work and send a payload with the event (using event value)?

It looks like you’re familiar with the basics but have you had a chance to review this article or the video about triggering component events?

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.

Exactly what I thought. Thanks for the input.
How do you define an event schema ? Can’t find anything on it in the doc.

Trigger schema, when you’re creating the trigger.

Yes, I know where it is, I don’t know what should be put in there !? JSON, Javascript, variables …
Do you have a Event schema exemple ?

Thanks.