Delivery fails because the targetData is undefined

Avatar

Avatar
Validate 10
Level 3
thibaultb473199
Level 3

Likes

25 likes

Total Posts

77 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 3
thibaultb473199
Level 3

Likes

25 likes

Total Posts

77 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
thibaultb473199
Level 3

07-08-2019

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Venu_Reddy
MVP

Likes

163 likes

Total Posts

171 posts

Correct reply

53 solutions
Top badges earned
Springboard
Establish
Give Back 25
Give Back 10
Give Back 5
View profile

Avatar
Springboard
MVP
Venu_Reddy
MVP

Likes

163 likes

Total Posts

171 posts

Correct reply

53 solutions
Top badges earned
Springboard
Establish
Give Back 25
Give Back 10
Give Back 5
View profile
Venu_Reddy
MVP

08-08-2019

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

Answers (4)

Answers (4)

Avatar

Avatar
Validate 1
Level 4
DimaKudryavtsev
Level 4

Likes

43 likes

Total Posts

44 posts

Correct reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
DimaKudryavtsev
Level 4

Likes

43 likes

Total Posts

44 posts

Correct reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
DimaKudryavtsev
Level 4

07-08-2019

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

Avatar
Contributor
MVP
Milan_Vucetic
MVP

Likes

166 likes

Total Posts

386 posts

Correct reply

135 solutions
Top badges earned
Contributor
Springboard
Shape 1
Validate 25
Validate 10
View profile

Avatar
Contributor
MVP
Milan_Vucetic
MVP

Likes

166 likes

Total Posts

386 posts

Correct reply

135 solutions
Top badges earned
Contributor
Springboard
Shape 1
Validate 25
Validate 10
View profile
Milan_Vucetic
MVP

07-08-2019

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

Avatar
Validate 1
Level 4
DimaKudryavtsev
Level 4

Likes

43 likes

Total Posts

44 posts

Correct reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
DimaKudryavtsev
Level 4

Likes

43 likes

Total Posts

44 posts

Correct reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
DimaKudryavtsev
Level 4

08-08-2019

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

Avatar

Avatar
Validate 10
Level 3
thibaultb473199
Level 3

Likes

25 likes

Total Posts

77 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 3
thibaultb473199
Level 3

Likes

25 likes

Total Posts

77 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
thibaultb473199
Level 3

07-08-2019

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.