Expand my Community achievements bar.

SOLVED

Delivery fails because the targetData is undefined

Avatar

Level 5

Hello everyone,

Since few days, some of my deliveries don't want to be send out and mention me that the targetData is not defined.

Here is how the error looks like :

nlclient_rfoEfwYL0w.png

This was not happening before (the workflow was on a scheduler without any modification in the template and one day, this happens with this failure) and I still have some deliveries that works with the targetData in other templates.

But for an obscure reason, this issue happens for all the targetData I use in that template. I try to delete a piece of code in the HTML with a use of the targetData but it fails again because of an other targetData.

Example of the targetData I use : <%= targetData.member.point_Bal_Val %> and this one is working in another template I use.

Do you already encounter this problem and if yes, how I can resolve that ?

If you need more information, feel free to ask.

Thanks in advance.

Kind regards.

1 Accepted Solution

Avatar

Correct answer by
Level 8

Hi

You can use in below format to test with a simple example

<targetData firstName="Forum"></targetData>

(else)

<targetData>

     <firstName ="Forum" />

     ......................................

     .....................................n

</targetData>

Regards,

Venu

View solution in original post

5 Replies

Avatar

Level 10

Hi,

If you are using a list (Read List) for target, workaround may be importing a list in Recipient schema.

Apart of that, important part is to provide targetData with alias name matching the field you need inside delivery.

Regards,

Milan

Avatar

Level 4

Hi

This is a common bug and the error message is actually wrong. When you have a JSSP tag in your delivery, something like <%= targetData.attributeName %>. If the attribute name is misspelled or wrong, the Adobe is unable to load the required column and targetData become undefined.

Said that, since your deliveries have been working before, I guess there are some data issues. In your case, when JSSP tag looks like <%= targetData.member.point_Bal_Val %> that probably means that you have some "member" table linked to a temporary table. If the table no longer exists or someone has renamed the attributes in it, you will see this error.

You can actually see what is loaded by your request. Click on "To" in Delivery Target Population, switch on Seed Address, add a new recipient and populate targetData as you think it should be.

1809172_pastedImage_0.png

Now, click on Preview, load seed recipient, and click on Data Loaded

1809194_pastedImage_2.png

You will get an XML with all loaded fields. Just check what they all have loaded correctly.

Avatar

Level 5

Hello DimaKudryavtsev​ ,

Thank you for the explanation and detail answer. I understand where I can maybe find the answer of this issue.

Since I never use the populate of the targetData, can you give me an example of hat I have to put between the <targetData></targetData> ?

To test with a simple exemple, I use in the template <%= recipient.firstName %> , how do I have to set up the <targetData></targetData> field ?

If there is documention also with that, it will be great to learn more about that

Thanks in advance,

Kind regards.

Avatar

Correct answer by
Level 8

Hi

You can use in below format to test with a simple example

<targetData firstName="Forum"></targetData>

(else)

<targetData>

     <firstName ="Forum" />

     ......................................

     .....................................n

</targetData>

Regards,

Venu

Avatar

Level 4

There actually example in the seed address page:

1809923_pastedImage_0.png

Have you seen it? Long story short, the targetData represents an XML that you are throwing on a delivery template to produce actual delivery and it maps to a temporary table schema. Any table column will become an attribute with the same name and any linked table will create a nested element with tag name equal to link name and attribute names, equal to linked table columns.

The delivery template will load these elements and attributes only if they are mention directly in JSSP tag. For example, the following expression will load @providerName column of a linked provider table.

<% var providerName = targetData.provider.providerName %>

But the following expression will only load provider @_cs and @providerName will be undefined:

<%

  var provider = targetData.provider

  var providerName = provider.providerName

%>

as for <%= recipient.firstName %>, you do not have to do anything, because the recipient is default Adobe table, and recipient record is always loaded if a recipient is targeted in the delivery.

Please check out this doc: Personalization fields