Skip to main content
Level 1
Nov 7, 2018 5:32 AM UTC
Solved

Contextual event data in custom code event

In the event code for a custom code event, is it possible to pass context data in the trigger function, to be available in the action code, in the same way that extension code can:

trigger({
  swipeAngle: 90 // the value would be the detected angle
});

(from Launch Documentation )

In the action code, this context does not seem to be available - the event object has only $type and $rule.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
aahardyAccepted solution
Adobe Employee
Nov 8, 2018 9:07 PM UTC

Thanks for bringing this up! I can confirm that this data doesn't get passed through currently, but there's no reason we can't support it. I'll put it on our list.

9 replies

Stewart_Schilling
Community Advisor
Community Advisor
Nov 7, 2018 1:57 PM UTC

Wow. I expected that this would work, but I'm seeing the same thing.

My Core > Custom Code is this:

And the Action of the same rule is this :

All I see in the console is :

   Rule "test custom code" fired.

  1. {$type: "core.custom-code", $rule: {…}}
    1. $rule:
      1. id: "RL02f3b17f28374cbfa44ec037d130a07c"
      2. name: "test custom code"
      3. __proto__: Object
    2. $type: "core.custom-code"
    3. type: "core.custom-code"
    4. get type: ƒ ()
    5. __proto__: Object
Translate
Level 6
Nov 8, 2018 1:54 PM UTC

How about using a direct call rule, there you can also pass data which then is available with event.detail

Translate
aahardyAdobe EmployeeAccepted solution
Adobe Employee
Nov 8, 2018 9:07 PM UTC

Thanks for bringing this up! I can confirm that this data doesn't get passed through currently, but there's no reason we can't support it. I'll put it on our list.

Translate
Level 1
Nov 8, 2018 10:06 PM UTC

Thanks everyone. I'll use direct call as a workaround for now, and look forward to seeing this in future.

Translate
Adobe Employee
Nov 15, 2018 10:31 PM UTC

The code is complete for this, but Adobe is going into a blackout period where we won't release new code during the holidays unless there is a critical issue. Because of this, the feature is set to be released in early January.

Translate
Stewart_Schilling
Community Advisor
Community Advisor
Nov 16, 2018 2:59 PM UTC

My birthday is in early January.  Maybe this will be my gift!

Thanks for the update.   I appreciate the care that you give to your work!

-Stew

Translate
Adobe Employee
Jan 9, 2019 4:12 PM UTC

This was released yesterday in version 1.4.2 of the Core extension.

Translate
jantzen_b
Adobe Employee
Adobe Employee
Jan 9, 2019 4:14 PM UTC

Happy Birthday Stew! looks like the Launch team delivered!

Translate
Stewart_Schilling
Community Advisor
Community Advisor
Jan 9, 2019 6:00 PM UTC

Indeed! Best gift ever!

On Wed, Jan 9, 2019 at 10:15 AM Jantzen.Belliston <forums_noreply@adobe.com>

Translate