Expand my Community achievements bar.

SOLVED

How to use segmentcode from workflow in delivery template

Avatar

Level 3

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

9 Replies

Avatar

Community Advisor

@RBE_jonas 

 

Try this

<%= targetData.segmentCode %> 

     Manoj
     Find me on LinkedIn

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 3
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.

Avatar

Level 3
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:

Avatar

Level 3
recipient.firstName:Jonas targetData.segmentCode:undefined targetData: ({})

Avatar

Community Advisor
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...

Avatar

Level 3
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..

Avatar

Community Advisor
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 )

Avatar

Level 6

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