Reference triggering program using a global smart campaign?

Jay_Jiang
Level 10

Reference triggering program using a global smart campaign?

Using a global smart campaign, how can one reference the program ID and program name of the triggering program? (not the parent of the global smart campaign)

Right now I have a smart campaign in each program but I want to set up one global smart campaign listening for:

pastedImage_1.png

but if I add call webhook in the flow of this smart campaign, it won't reference the program that triggered it.

FYI, I have tried using "Campaign is requested" in the global smart campaign and request campaign in each of the other programs. This doesn't work either.

If I had to use pseudo code to explain it, I want...

$('program').find('[name^=SE] , [name^=VE]').changed(function(){
doSomething($(this));
});
6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Reference triggering program using a global smart campaign?

You're talking about some sort of forwarding of the original trigger context. Unfortunately, can't be done.

(Not sure JavaScript-type this is a good comparison, because this can be either lexical or call-site or non-modifiable/global!)

Justin_Norris1
Level 10

Re: Reference triggering program using a global smart campaign?

The work-around I would use in this scenario is to stamp the program-specific data values to person fields using Change Data Value then request the global smart campaign and reference those person fields in your subsequent actions. 

At least this still allows you to centralize the repetitive actions into a single global "service." 

SanfordWhiteman
Level 10 - Community Moderator

Re: Reference triggering program using a global smart campaign?

Sorta... but you've got a race condition.

Justin_Norris1
Level 10

Re: Reference triggering program using a global smart campaign?

Can you expand Sandy? 

Is it because the values from the CDV flow step are not guaranteed to be written to the database by the time they are referenced in the subsequent requested campaign? 

SanfordWhiteman
Level 10 - Community Moderator

Re: Reference triggering program using a global smart campaign?

Not because of that, but because if the same lead runs through multiple times before the requested campaign is finished (or even invoked) the values will have changed to the latest.

Jay_Jiang
Level 10

Re: Reference triggering program using a global smart campaign?

Not ideal but functional... I think the biggest risk is sending the wrong data if campaigns are tweaked or new ones aren't set up the correct way...