Posts

Showing posts with the label Adobe Campaign

Campaign classic sequence of execution of different Javascript Code Bloc inside a workflow delivery

Image
 Every time I have to add some advanced JS code inside Delivery I am confused about the sequence of JS. When it comes to Delivery, then there are multiple places where you can write the JS  Right Click on Delivery > Open > Go to Script Tab  Right Click on Delivery > Open > Go to Advanced Tab Typology Rule of type Control There are many phases where the rule will be run. I was trying to run the rule as much late as possible and thus had chosen "At the end of the analysis" Ignoring the option of adding JS code inside the Routing External account > Connector and Post processing workflow as I didn't run that Here is the result While the delivery is waiting at "Approve Targeting" , the log for the recurring delivery activity at workflow level looks like below The delivery log looks like below for the Typology Rules Note: At this stage the broadlog is not created and that makes sense as the Targeting is not approved yet While the  delivery is waiting at...

Looping using subset inside a big batch in Adobe Campaign

Image
 I had many scenarios where I ran a costly query to select some good no of records and then process them further. But when it comes to processing I had to restrict the number of records to be processed in one go. And once the subset is processed, then select from the table again and then process the subset. Something like below where the end activity calls the signal when the complement from Split has more than 0 records to start the whole process again. But the problem is every time you have to run the costly select process to process a fraction of the records. As a result the overall throughput is decreased heavily. As an alternate I used a looping through the selected records avoiding selection every time I need to process the subset. Here the JS Activity after select is dummy one but required. I added a log in it with count. Test activity is also needed to ensure we have the exit path from the loop. In the above example the select query fetched 8680 records and then split restr...

Broadlog Resequencing in Adobe Campaign Classic

 As we all know, the max value for any auto primary key field in Adobe is limited by the max of int which is 2.15B [[+/-) 2,147,483,647]]. As ACC doesn't support bigint as the auto pk column data type, you have to recycle the number every time it reaches near to that 2.14B mark.  Now Broadlog tables being the most heavily used table in ACC, we observe the issue often with this table but this can happen with other tables as well like Tracking and so on. It is not difficult to recycle the value of the sequence in ACC, but most of the time the BL and TL data is shared with downstream systems. So, once you reset the sequence, you have to make sure the downstream system knows about it and handle it properly without overwriting the existing historical records. And that is where these types of challenges are faced How do we inform downstream when ACC is resetting its sequence If downstream is managing the uniqueness of the records, then they have to prefix something to make sure it i...

Base 64 Encoding using Adobe Campaign Standard

 For one of the integration we had to do the base64 encoding using ACS and it was not that easy initially with the existence of the "MYTH" that ACS doesn't support JavaScript. Here is the code where I declared a class Converted inside a Content Block (it has to be block, not fragment) named "cbBase64EncodeLib" Note this process is only applicable if you have to use the encoded output inside email, it will not work if you need to save the value in a table <% var Converter ={         _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",         hexToBase64: function(hex) {             //var str = Converter.hexToString(hex);             //return Converter.base64Encode(str);             var hexStr = hex.toString(); //force conversion             var binary = "";           ...

User Custom Event Variables in Adobe Campaign Standard Workflow

Image
We all are very much familiar with variables in Campaign Classic. But in Standard, it is not easy to declare or use variables inside workflow. There are activities like Load File, Transfer File and other which supports the variables like var.filename or other activities supporting var.reccount in the same way as Classic. But using custom variable is not as simple as ACC and here is one of the ways I tried The first End Activity is calling the Signal activity and while calling, passing the variables and their values as below Below  Signal activity is configured with the same set of variables as the End Activity above. Also you have the option to mention the data type of the variables (String and Number in this case). In the Query Activity (which for no reason I choose the Sending Log as dimension), you can add the variables using the syntax $(var/@varName) format as was used in Classic. Also the $Int exists as well. I tried to check different outcomes as you can see in the screensho...

Displaying data in an email from one to many relation table

Image
We know that boradLogRcp has a one to many relationship (1 to N) with recipient schema. So for every recipient I want to show all the emails sent to him/her Create a simple workflow to select the recipients of your choice Add a delivery/recurring delivery and pull the OTB default email template and configure it with below code <TABLE> <TBODY> <TR> <TD>Campaign name</TD> <TD>Delivery Name</TD> <TD>Event Date</TD> </TR> <% for(var i = 0 ; i<recipient.broadLog.length; i++) { document.write("<tr>"); document.write("<td>" + recipient.broadLog[i].delivery.operation.label + "</td>"); document.write("<td>" + recipient.broadLog[i].delivery.label + "</td>"); document.writ...

How to make Offer Code mandatory and unique

Image
While working on a requirement on Adobe Campaign Classic, I got a requirement to make the offer code mandatory and unique. Initially it seemed to be an easy requirement as I can just create a unique key on the offer code field. But later realized that, every offer has another version of the same stored in the same schema nms:offer for the live environment. Adobe automatically creates the internal name as ogininalName_liveRcp while deploying the offer to the live environment (don't know how that is done yet, may be a post for future :)). But for other fields, it is copied as is and so is the offer code too. So unique key is not option. Then thought, if I add another field in the nms:offer schema for the environment and make the key with offer code + the environment. But same deployment problem, how do I set the env variable as part of deployment? So decided to go with the toughest but cleanest solution, SOAP call from input form. Here are the steps for the same. You can follow a...

Adobe Campaign Schema - Template vs Aggregate

Image
While looking into the schema, I saw in some places we are referring to an element of a different schema instead of declaring it again and again. But in some places, it is done using template attribute and other places use aggregate attribute. So to test, I though of using the element "auditTrail" declared inside the library xtk:common The element is as as below   <element name="auditTrail">     <element defOnDuplicate="true" name="createdBy" template="xtk:common:createdBy"/>     <element defOnDuplicate="true" name="modifiedBy" template="xtk:common:modifiedBy"/>     <attribute defOnDuplicate="true" default="GetDate()" desc="Creation date" label="Creation date"                name="created" type="datetime"/>     <attribute defOnDuplicate="true" default="GetDate()" desc="Modification date...

Adobe Campaign Survey - Save Variables into Database

Image
I had a scenario where I need to show some questions depending on the answers of a previous question. For example, the below test scenario So I created the Archive field for all the questions including the Radio button and Drop down one which will be used for the dynamic criteria. I had setup the visibility of the field using the Archive Field. But while previewing I realized that the questions are getting shown or hidden depending on selection (example below). So I created two new variables for the survey with names as How_was_your_last_hopital_visit and Was_your_out_of_pocket_expenses_over_budget_. Then changed the visibility criteria to use the variables. Now it is working perfectly. But when I saved the survey, it doesn't save the data of those variables. But I need those selections as well. So I added a javascript task before the Storage activity and set the tables fields from the variables so that when it is in the storage activity, it column value is populate...

Adobe Campaign: Call Java Script from Input Form

I came across a scenario where I need to do some custom auditing when some fields are  changed via an input form. So for that I had to call javascript functions from an input form. I have custom schema as cus:Preference with 1:1 join with nms:Recipient. And audit was required to capture who is making change to the preference page if any. Step 1: Create an entry in the input form for the soapCall.  <form>   <container > <!--Enter the form fields here-->   </container>   <leave> <!--servi = "name of the schema where the method is declared"-->     <soapCall name=" auditPreference " service=" cus:Preference ">       <param exprIn="[@id]" type="int"/>       <param exprIn="[@recipientId]" type="int"/>       <param exprIn="[@prefAllCommunications]" type="boolean"/>       <param exprIn="[@prefAllCommunicationsModifiedDat...