InsightIQ Blog

3.0 Tricks of the Trade in Unica V75 – Printing a Mail List File Even When There are No Records

View more Blog Posts

Oct 7 2009

Have you ever tried to get a Unica V75 mail list file to print out even when there is no data to print out (i.e. no records selected for the mail list)? If you said "Yes" to this question, what did you see in the output on the Unica Campaign server folder? We will come back to this question in a minute.

A favorite client of mine asked if I knew how to print out a "Dummy" row of data in a Unica Campaign mail list file when there were no actual records selected for the mail list. My response was based upon my understanding of Unica Campaign's functionality regarding empty mail list files. I told my client that you would have to use a shell script to perform this feat because I thought Unica Campaign didn't generate a mail list file if there are no records selected by the mail list process box. Boy, was I wrong! For this edition of tricks of the trade we are going to find out how to trick Unica Campaign into creating a dummy list pull file even when there are no records selected by the Unica mail list process!

So if you answered my question above, "Have you ever tried to retrieve a mail list from Unica Campaign when no records were select by the mail list process box?", your answer was probably that there is no file created.

If there are no records in the mail list file generated by Unica Campaign V75, then there will not be a file generated by the flowchart session.

So we will need to "trick" Unica Campaign into generating a file even when there are no records in the mail list box. My client's requirement was that the 3rdparty email list processor wanted to receive a file even when there were no records. This makes good sense since if no file is sent then the 3rd party list-processor would not know whether the process either did not complete successfully or that there were no records to mail for that particular day. The solution to this trick is actually quite simple. In order to trick Unica, we just need to create the dummy file first and then if there are actual records for that day we need the actual file to overwrite (i.e. replace) the dummy file. Got it? Here are the steps you can use to recreate this trick:

  • STEP 1. Open flowchart
  • STEP 2. Create user variables for dummy file
  • STEP 3. Create mail list process box #1 (the dummy file)
  • STEP 4. Create mail list process box #2 (the actual file)

Each of these steps has been detailed below so that you can create a dummy file even when there are no records selected by your mail list process in Unica Campaign.

  • STEP 1. Open flowchart

Open a flowchart in the edit mode and add a select process box that generates the dynamic date stamp for the "dummy" version of the mail list file (to see more about creating this dynamic date stamp please refer to a previous blog of mine entitled "How do I dynamically add a date stamp to my list files?"). Figure 1 below shows this select process box with the derived field.

Figure 1. Select process box and derived field for dynamic date stamp

pp3 

  • STEP 2. Create user variables for dummy file

Now you can create the columns (fields) that you want in your mail list file. For my example I created user variables to represent each of the following fields; Title, First Name, Last Name, Email Address, Cell Code, Cell Type. Obviously you would want to create the fields exactly as you need them for your mail list file. Figure 2 shows what the user variables should look like for this step.

 Figure 2. User variables are used to create the columns for the dummy mail list file.

 pp4

  • STEP 3. Create mail list process box #1 (the dummy file)

In order to create the dummy mail list file, we are going to create a dummy mail list process box that runs prior to our actual mail list process box. This is the heart of the trick since we need to always ensure that a file will be generated by Unica even when there are no records to select for a given day. So for this mail list process box we select the personalize tab and then add the fields from our user variable. Notice how in Figure 2 above I purposely left the values for the user variables NULL. In order to get the column names to display properly I created a derived field from each of the user variables as is displayed in Figure 3 below.

Figure 3. Personalize tab for the dummy mail list process box

 pp5

  • STEP 4. Create mail list process box #2

Finally, we will need to create our "Actual" list pull select process and mail list process boxes in Unica. I used a precedence connection to ensure that my dummy process would always run prior to my actual process. Figure 4 displays the complete flowchart for this trick. The only thing that you need to do in the actual mail list process box, besides naming the file name exactly the same as the file name in the dummy mail list process box, is to select the replace all records (or even the create new file) radio button on the Fulfillment tab. Figure 5 displays the select of the "Create New File" radio button.

 Figure 4. Complete flowchart in order to "always" generate a mail list file

 pp6

Figure 5. The essence of the trick is that the dummy file is overwritten by the actual file

 pp7

 

So the way our flowchart works is the dummy mail list process box creates a file with no records in it. If you run the flowchart just up to the dummy mail list process box you will get a mail list file that looks like the one depicted in Figure 6.

 Figure 6. Dummy file created by dummy mail list process box (note that there are no rows)

 pp1

Now you are ready to run your process from end-to-end. If there happen to be records selected for the day, then our process will generate the actual list and it will overwrite the dummy list. Figure 7 displays how the actual list file now exists and it has a row of data in it.

Figure 7. Actual mail list file - when there are records selected

pp2

Note: since the file has the exact same name as the dummy file, it overwrites that file. If  you have a day where there are no records selected for the actual mail list process box then your dummy file will remain. The reason this trick works is because Unica will not generate a list file when the mail process box does not select any records. As you recall from our discussion above, Unica will not generate a mail list file when there are no records selected by the mail list process box and consequently our dummy file will not be overwritten. So this trick served to meet our client's requirements without incorporating UNIX shell scripting. We just had to trick Unica into doing it.

You can respond with your feedback by adding a comment to my blog or by dropping me a line at greg_denlea@csgsystems.com.

You can also read my previous tricks of the trade blogs "How do I dynamically add a date stamp to my list files?" and Copying and Pasting in Unica Campaign.

View more Blog Posts

Leave a Comment

  • Your email won't be published on our site.

All Fields Required