Customer Journey Configuration: Difference between revisions

From SMTX Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 25: Line 25:
== Javascript Examples ==
== Javascript Examples ==
Below are some common used scripts that can be reused in your projects
Below are some common used scripts that can be reused in your projects
=== Check if moment already has a startdate, if not set it
=== Check if moment already has a startdate, if not set it ===
  var currentvalue = '#MOMENT-dossier-klaar||date||#';
  var currentvalue = '#MOMENT-dossier-klaar||date||#';
  if (currentvalue) return currentvalue;
  if (currentvalue) return currentvalue;

Revision as of 15:44, 21 December 2022

Below are some examples for referring to fields in the customer journey

Customer Journey References

These references are examples for retrieving data from the Customer Journey

Moments

Planned Start Date

#MOMENT-name-of-moment||date||#

Actions

Planned Start Date

#ACTION-name-of-action||date||#


Variables

#VARIABLE-name-of-variable||value||#

Common Process References

Customer Journey process start date

#REPLACE-STEP-PROCESS-DateStarted-yyyyMMdd#

Customer Journey process id

#REPLACE-STEP-PROCESS-Id#

Javascript Examples

Below are some common used scripts that can be reused in your projects

Check if moment already has a startdate, if not set it

var currentvalue = '#MOMENT-dossier-klaar||date||#';
if (currentvalue) return currentvalue;
if ('#VARIABLE-dossier-klaar||value||#' === 'yes') 
 {
   return CommonInterface.utcDateToString(new Date(), "yyyyMMddHHmmss");
 }
return ;