Expand my Community achievements bar.

SOLVED

Typology rule

Avatar

Level 5

How can I do with a Typology Rule that a delivery is not sent after the end date of the campaign?

 

@_Manoj_Kumar_ @ParthaSarathy @Parvesh_Parmar @DavidKangni 

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi @alnavarg, I had the same Doubt, @ParthaSarathy gave me a good answer to it, I Copy it:

Create a Typology rule under /Administration/Campaign Management/Typology management/Typology rules/

And select the type as 'Control' and configure as below

CampaignerForLife_0-1690368146988.png

 

In code tab, add the below script:

var internalName = delivery.internalName;
var query = xtk.queryDef.create(<queryDef operation="select" schema="nms:delivery">
                                          <select>
                                              <node expr="@internalName"/>
                                              <node expr="@id"/>
                                              <node expr="@created"/>
                                              <node expr="[operation/@id]"/>
                                              <node expr="[operation/@end]"/>
                                           </select>
                                          <where>
                                            <condition expr={"@internalName = '"+internalName+"'"}/>
                                          </where>
                                        </queryDef>);
var record = query.ExecuteQuery();

for each (var variable in record) {
var campaignEndDate = variable.operation.@end;
var deliveryCreationDate = formatDate(variable.@created, "%4Y-%2M-%2D");
if( deliveryCreationDate > campaignEndDate)
{
logWarning("Delivery Creation Date crossed campaign End Date");
return false; 
}
else{
return true;
}
}

And create a new 'Typology' and add the above created typology rule in it.

 

When creating a campaign delivery, use this typology in delivery property.

Now if the Delivery creation date is greater than campaign end date, then the delivery gets failed with the Audit log as 'Delivery Creation Date crossed campaign End Date'

 

CampaignerForLife_1-1690368147062.png

 

Credits to @ParthaSarathy 

View solution in original post

2 Replies

Avatar

Community Advisor

Hi @alnavarg 

 

You can create a filter type typology with targeting dimension as nms:Campaign and filtering conditions as below 

AkshayAnand_0-1690363097516.png

Regards

A

Avatar

Correct answer by
Level 7

Hi @alnavarg, I had the same Doubt, @ParthaSarathy gave me a good answer to it, I Copy it:

Create a Typology rule under /Administration/Campaign Management/Typology management/Typology rules/

And select the type as 'Control' and configure as below

CampaignerForLife_0-1690368146988.png

 

In code tab, add the below script:

var internalName = delivery.internalName;
var query = xtk.queryDef.create(<queryDef operation="select" schema="nms:delivery">
                                          <select>
                                              <node expr="@internalName"/>
                                              <node expr="@id"/>
                                              <node expr="@created"/>
                                              <node expr="[operation/@id]"/>
                                              <node expr="[operation/@end]"/>
                                           </select>
                                          <where>
                                            <condition expr={"@internalName = '"+internalName+"'"}/>
                                          </where>
                                        </queryDef>);
var record = query.ExecuteQuery();

for each (var variable in record) {
var campaignEndDate = variable.operation.@end;
var deliveryCreationDate = formatDate(variable.@created, "%4Y-%2M-%2D");
if( deliveryCreationDate > campaignEndDate)
{
logWarning("Delivery Creation Date crossed campaign End Date");
return false; 
}
else{
return true;
}
}

And create a new 'Typology' and add the above created typology rule in it.

 

When creating a campaign delivery, use this typology in delivery property.

Now if the Delivery creation date is greater than campaign end date, then the delivery gets failed with the Audit log as 'Delivery Creation Date crossed campaign End Date'

 

CampaignerForLife_1-1690368147062.png

 

Credits to @ParthaSarathy