Adding targetData logic in an email | Community
Skip to main content
May 12, 2022
Solved

Adding targetData logic in an email

  • May 12, 2022
  • 1 reply
  • 1294 views

Hi I'm very new to ACS, and was hoping someone can help me out.  I built an email and I'm trying to access targetData in the email for the make and model of a car.  I put the code below in the email (I tried "context.targetData" and "context.profile.targetData") and I just get back when I preview "'targetData' element unknown (see definition of 'Enrichment (temp:enrichment1-src)' schema)."  How do I fix this please?

 

<% var aVehicle = 'vehicle';
var aField1 = targetData.Make;
var aField2 = targetData.Model;
if( aField1 != '' || aField2 != '') { aVehicle = aField1 + ' ' + aField2; } document.write(aVehicle); %>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by bisswang

indeed you can't configure target data on test profiles

 

To test it completly, you need to use profile substitution feature:

https://experienceleague.adobe.com/docs/campaign-standard-learn/tutorials/communication-channels/email/profile-substitution.html?lang=en

1 reply

deuceAuthor
May 13, 2022

I wasn't using the entire variable being pulled in from targetData.  It should have been:

 

context.targetData.cusWorkOrderLink1.Make;
 
Now I'm just having trouble testing with the test profiles since none of them have the data.
bisswangAdobe EmployeeAccepted solution
Adobe Employee
May 18, 2022

indeed you can't configure target data on test profiles

 

To test it completly, you need to use profile substitution feature:

https://experienceleague.adobe.com/docs/campaign-standard-learn/tutorials/communication-channels/email/profile-substitution.html?lang=en