Skip to main content
Nintex Community Menu Bar
Question

Is it possible to set publishing scope on calls to skuid.events.publish(event, data) ?


Forum|alt.badge.img+3

Hello I would like to publish an event to send data from a skuid aggregate model to a lightning component.

skuid.events.publish(‘AggMessage’, JSON.stringify(payload));

AggMessage is never making it to the component listing on

<aura:handler event=“skuid:event” action=“{!c.handleSkuidEvent}”/>

I’m assuming this is because the publishing scope of AggMessage needs to be set to “All active pages and Lightning Components” How do I set event scope from code?

Thanks,
Peter

Translate
Did this topic help you find an answer to your question?
This topic has been closed for comments

Forum|alt.badge.img+3

Here’s another alternative/related question.

I made the event below with the builder with publish to Lightning Components scope and my component is receiving it. How do I add data payload to this event?

Thanks,
Peter

Translate

Forum|alt.badge.img+13

You can add Parameters by clicking the “+” icon on the Publish Event action. This lets you provide key-value pairs of data that is sent to the Lightning Component as an object.

Translate

Forum|alt.badge.img+13

The “Publish Event” action type in the Action Framework is the highly recommended way to set the publishing scope to “All active Skuid Pages and Lightning Components”. Technically yes it is possible to specify the scope via the JavaScript API but we’d like to avoid customers using that unless for some reason using the declarative “Publish Event” action is not working.

Translate

Forum|alt.badge.img+3

Fantastic! When I click on the disk icon to select a field to use as a value doesn’t popup anything? I’m not sure what syntax I should use for the </> button. How do I add a field from an aggregate model?

Translate

Forum|alt.badge.img+3

OK, I’m hopeful!   Thanks! Peter

Translate

Forum|alt.badge.img+13

If you want to pull in a Model field as a value, you can use {{{$Model.YourModelName.data.0.The_Field_You_Want__c}}}

Translate

Forum|alt.badge.img+3

It worked!   Thank you so much!

Translate

Forum|alt.badge.img+10

Hi Zach… I’m having to trigger an event from an html submit button in a Skuid template component which the Lightning component can listen for.

My current approach is to listen for an event locally on the Skuid page (skuid.events.publish(‘some.event’)) and to then use an event-triggered sequence in Skuid to listen to this and then publish another event via the action-framework to the surrounding Lightning Component using the broader scope.

This is working fine but it’d be nice to know how to publish to the broader scope straight from javascript rather than using the above two-step process. Any chance you could spill the beans on this?

Just a note - I also found that you had to set the even-triggered sequence to “All Active Pages and Lightning Components” for the above listener to work - even though the javascript was publishing the event from a snippet in the same Skuid page.

Translate

Forum|alt.badge.img+10

An alternative approach would be to be able to trigger an event-triggered sequence from within a snippet/javascript

Translate

Forum|alt.badge.img+13

I’ll go ahead and post the way to set publishing scope to “All Skuid Pages and Lightning Components” via JavaScript:

skuid.events.publish("AggMessage", [payload], { scope: skuid.constants.EVENT_SCOPES.GLOBAL });
Translate

Forum|alt.badge.img+10

Thank you!!! 🙂

Translate

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings