How to manage a JS code task with an embedded data that doesn't exist | XM Community
Skip to main content

Hello,

I made a workflow with multiple calculation, based on embedded data, with a JS code task. My trigger is an Experience ID when any change happen for any contact.

I have a issue when a embedded is missing for one contact. The task is getting on error. I understand why but I need to find something for contournate this problem. I’ve tried to check if the ED is null or undefined but nothing work. Qualtrics doesn’t want to execute a task with an embedded called but no existed.

Here is an exemple of my work:

function codeTask() {

var1 = ~{qde://supplemental.embeddedData.AS_COMPLETED_CAMPAIGNS}
if (var1 != null) {
KPI_AS001=1;}
else {
KPI_AS001=2;}



return {
KPI_AS001
};
}

Thanks for your help,

J.

Please check the value of ED being taken when it is missing. May be then you can handle it.


Check what is the value of the ED when  it is missing from contact. May be then you will be able to handle.


Leave a Reply