Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to use segmentcode from workflow in delivery template

Avatar

Avatar
Affirm 1
Level 1
RBE_jonas
Level 1

Like

1 like

Total Posts

22 posts

Correct Reply

1 solution
Top badges earned
Affirm 1
Boost 1
Validate 1
View profile

Avatar
Affirm 1
Level 1
RBE_jonas
Level 1

Like

1 like

Total Posts

22 posts

Correct Reply

1 solution
Top badges earned
Affirm 1
Boost 1
Validate 1
View profile
RBE_jonas
Level 1

18-05-2021

I am trying to access the segment code defined in a workflow split, in the personilazation step in a delivery template. However some steps need to be taken in order to include the segment code in the target data object. I fail to understand how this is done. I wish to hava recipients divided into segments, with personalized content based on segments in the same delivery. targetData.@segmentCode remains empty. Any help is greatly appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 10
Level 3
CedricRey
Level 3

Likes

24 likes

Total Posts

65 posts

Correct Reply

12 solutions
Top badges earned
Boost 10
Applaud 5
Boost 5
Affirm 5
Give Back
View profile

Avatar
Boost 10
Level 3
CedricRey
Level 3

Likes

24 likes

Total Posts

65 posts

Correct Reply

12 solutions
Top badges earned
Boost 10
Applaud 5
Boost 5
Affirm 5
Give Back
View profile
CedricRey
Level 3

18-05-2021

Hello Jonas,

First, you shouldn't use the E4X notation into the content of a delivery. This is deprecated and it doesn't work into the newest build of Adobe Campaign.

Usually, if you delete the "@", it works if you use the segmentation :

<%=targetData.segmentCode%>

I've just test it with success.

First, can you verify if there is datas into the segmentCode columns ? (put a 1h wait activity just before the delivery, then right clic and "display the target" and check if you see something into the Segment code).

Also, have you choose the "specify into the transition" for recipient origin on the delivery activity into your workflow ?

 

Cedric

RBE_jonas
thank you for your quick reply! For me, the delivery object has "Specified by the inbound event(s)" under "recipients" selected (which I believe is the same thing you refer to). The segement code is shown when I chose "Display Target" (in column @segmentCode) and my personalization code produces <%= targetData.segmentCode %> when I preview the delivery (without personalization). Yet, when I preview with personalization the segment code is blank.
RBE_jonas
I have added: <div>recipient.firstName:<%= recipient.firstName %></div> <div>targetData.segmentCode:<%= targetData.segmentCode %></div> <div>targetData: <pre><%= targetData.toSource() %></pre></div> with the following result:
RBE_jonas
recipient.firstName:Jonas targetData.segmentCode:undefined targetData: ({})
CedricRey
Ho well, I need to know something important : what do you mean when you say "when I preview" ? Because the nature of "targetData" (comes from a temporary table from workflow), it is impossible to use the preview tab into the content of a delivery when the data comes from a workflow (i.e the targetData). You have to send the delivery (of course, use the proof sending functionnality for your test, with address substitution) to see the targetData works. It is a limitation of the use of targetData, due to its nature. If you really need to make some preview, you'll have to keep your data into a custom schema, process it in your workflow, Edit the target record load query into the delivery etc. Not so convinient...
RBE_jonas
When I preview: Workflow (with defined segmentcode) creatates a delivery (in Prepare-mode) I go to the newly created delivery, and chose preview-tab and enter recipient from "Delivery target population". Also tried with sending a proof with segmentCode defined in the proof settings of the delivery template. I can see the segment code in the delivery log, but preview is undefined/emtpy object. HOWEVER: if I click on the "dispaly mirror message" in the delivery log-tab I CAN SEE IT. Thank you! Did not understand that preview with personalization does not work with targetData..
CedricRey
Glad to help. The fact is when you preview, Campaign loads every part needed to personalize the content. But if those parts are not available anymore, it can't load it. In a workflow, the datas are only accesible by itself, not outside (temporary table). Those datas are also deleted when workflow stop / restart or when not needed anymore. So it's impossible for an outside element to access those datas, the only way to access it is when the workflow itself generates and prepares the delivery. And when you preview, those datas are not available (... this is technicaly not fully true, as you can see in miror page, but I try to simplify 😉 )
LaurentLam

Just a quick hint:

Avoïd too complex personnalization code in your delivery

Less works MTA will have to process for one delivery part, better it will be

So, in your case, 2 ways to implement this correctly with a segment Code:

1- you do not have any throughput issue and you want to factorize most things in a delivery template

-> extend your broadlog schema and enrich your mapping in order to save the segmentCode at broadlog level... It will helps for reporting / analysis purpose. Specially if someone can move from a segment to another depending of the day (imagine a segment like "recipient less than 25 years old": the 24 years olds recipient will move to another category after its birthday)

2- you can also use your split to call different templates regarding the segmentation: you will not have reporting problem (delivery code could be used as a segmentation code) and you could maximise the personnalization regarding the different segment

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

111 likes

Total Posts

310 posts

Correct Reply

97 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

111 likes

Total Posts

310 posts

Correct Reply

97 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile
_Manoj_Kumar
MVP

18-05-2021

@RBE_jonas 

 

Try this

<%= targetData.segmentCode %>