Skip to main content
deleted 3 characters in body
Source Link
Niko
  • 2.8k
  • 2
  • 10
  • 25

As you mentioned you can either create a separate Automation that would run only on Saturdays or if it is crucial to run everything within one Automation with that specific schedule then you can do that:

  1. Create Data Extension, let's call it "Sunday_Check" with the field "isSunday" (Boolean, nullable);
  2. In your Automation that would have a daily running schedule set as a first step Script Activity:
<script type="javascript" runat="server">
Platform.Load("Core", "1");    

/* Cleans whole Data Extension */
var prox = new Script.Util.WSProxy();
var action = "ClearData";
var props = { CustomerKey: 'xxxx' }; /* Change 'xxxx' to Data Extensions' External Key */
var data = prox.performItem("DataExtension", props, action);

/* Checks if today is Sunday, then add record to DE */
var isSunday = (new Date().getDay());
if( isSunday == 0 ) /* Sunday = 0, Monday = 1 and so on */
    var rowDeleterowAdd = Platform.Function.InsertData('Sunday_Check',['isSunday'],['True']);
else 
    
</script>
  1. In the Automation add Verification Activity to validate "Sunday_Check" Data Extension having Count is greater than 0 then stop the automation
  2. This way, each day you would have a check whether today is Sunday and if it is then the DE would be populated with a record, and the Verification Activity would stop the Automation because of that. On other days, it would simply let the Automation run the next steps.

As you mentioned you can either create a separate Automation that would run only on Saturdays or if it is crucial to run everything within one Automation with that specific schedule then you can do that:

  1. Create Data Extension, let's call it "Sunday_Check" with the field "isSunday" (Boolean, nullable);
  2. In your Automation that would have a daily running schedule set as a first step Script Activity:
<script type="javascript" runat="server">
Platform.Load("Core", "1");    

/* Cleans whole Data Extension */
var prox = new Script.Util.WSProxy();
var action = "ClearData";
var props = { CustomerKey: 'xxxx' }; /* Change 'xxxx' to Data Extensions' External Key */
var data = prox.performItem("DataExtension", props, action);

/* Checks if today is Sunday, then add record to DE */
var isSunday = (new Date().getDay());
if( isSunday == 0 ) /* Sunday = 0, Monday = 1 and so on */
    var rowDelete = Platform.Function.InsertData('Sunday_Check',['isSunday'],['True']);
else 
    
</script>
  1. In the Automation add Verification Activity to validate "Sunday_Check" Data Extension having Count is greater than 0 then stop the automation
  2. This way, each day you would have a check whether today is Sunday and if it is then the DE would be populated with a record, and the Verification Activity would stop the Automation because of that. On other days, it would simply let the Automation run the next steps.

As you mentioned you can either create a separate Automation that would run only on Saturdays or if it is crucial to run everything within one Automation with that specific schedule then you can do that:

  1. Create Data Extension, let's call it "Sunday_Check" with the field "isSunday" (Boolean, nullable);
  2. In your Automation that would have a daily running schedule set as a first step Script Activity:
<script type="javascript" runat="server">
Platform.Load("Core", "1");    

/* Cleans whole Data Extension */
var prox = new Script.Util.WSProxy();
var action = "ClearData";
var props = { CustomerKey: 'xxxx' }; /* Change 'xxxx' to Data Extensions' External Key */
var data = prox.performItem("DataExtension", props, action);

/* Checks if today is Sunday, then add record to DE */
var isSunday = (new Date().getDay());
if( isSunday == 0 ) /* Sunday = 0, Monday = 1 and so on */
    var rowAdd = Platform.Function.InsertData('Sunday_Check',['isSunday'],['True']);
else 
    
</script>
  1. In the Automation add Verification Activity to validate "Sunday_Check" Data Extension having Count is greater than 0 then stop the automation
  2. This way, each day you would have a check whether today is Sunday and if it is then the DE would be populated with a record, and the Verification Activity would stop the Automation because of that. On other days, it would simply let the Automation run the next steps.
added 39 characters in body
Source Link
Niko
  • 2.8k
  • 2
  • 10
  • 25

As you mentioned you can either create a separate Automation that would run only on Saturdays or if it is crucial to run everything within one Automation with that specific schedule then you can do that:

  1. Create Data Extension, let's call it "Sunday_Check" with the field "isSunday" (Boolean, nullable);
  2. In your Automation that would have a daily running schedule set as a first step Script Activity:
<script type="javascript" runat="server">
Platform.Load("Core", "1");    

/* Cleans whole Data Extension */
var prox = new Script.Util.WSProxy();
var action = "ClearData";
var props = { CustomerKey: 'xxxx' }; /* Change 'xxxx' to Data Extensions' External Key */
var data = prox.performItem("DataExtension", props, action);

/* Checks if today is Sunday, then add record to DE */
var isSunday = (new Date().getDay());
if( isSunday == 0 ) /* Sunday = 0, Monday = 1 and so on */
    var rowDelete = Platform.Function.InsertData('Sunday_Check',['isSunday'],['True']);
else 
    
</script>
  1. In the Automation add Verification Activity to validate "Sunday_Check" Data Extension having Count is greater than 0 then stop the automation
  2. This way, each day you would have a check whether today is Sunday and if it is then the DE would be populated with a record, and the Verification Activity would stop the Automation because of that. On other days, it would simply let the Automation run the next steps.

As you mentioned you can either create a separate Automation that would run only on Saturdays or if it is crucial to run everything within one Automation with that specific schedule then you can do that:

  1. Create Data Extension, let's call it "Sunday_Check" with the field "isSunday" (Boolean, nullable);
  2. In your Automation that would have a daily running schedule set as a first step Script Activity:
<script type="javascript" runat="server">
Platform.Load("Core", "1");    

/* Cleans whole Data Extension */
var prox = new Script.Util.WSProxy();
var action = "ClearData";
var props = { CustomerKey: 'xxxx' }; /* Change 'xxxx' to Data Extensions' External Key */
var data = prox.performItem("DataExtension", props, action);

/* Checks if today is Sunday, then add record to DE */
var isSunday = (new Date().getDay());
if( isSunday == 0 )
    var rowDelete = Platform.Function.InsertData('Sunday_Check',['isSunday'],['True']);
else 
    
</script>
  1. In the Automation add Verification Activity to validate "Sunday_Check" Data Extension having Count is greater than 0 then stop the automation
  2. This way, each day you would have a check whether today is Sunday and if it is then the DE would be populated with a record, and the Verification Activity would stop the Automation because of that. On other days, it would simply let the Automation run the next steps.

As you mentioned you can either create a separate Automation that would run only on Saturdays or if it is crucial to run everything within one Automation with that specific schedule then you can do that:

  1. Create Data Extension, let's call it "Sunday_Check" with the field "isSunday" (Boolean, nullable);
  2. In your Automation that would have a daily running schedule set as a first step Script Activity:
<script type="javascript" runat="server">
Platform.Load("Core", "1");    

/* Cleans whole Data Extension */
var prox = new Script.Util.WSProxy();
var action = "ClearData";
var props = { CustomerKey: 'xxxx' }; /* Change 'xxxx' to Data Extensions' External Key */
var data = prox.performItem("DataExtension", props, action);

/* Checks if today is Sunday, then add record to DE */
var isSunday = (new Date().getDay());
if( isSunday == 0 ) /* Sunday = 0, Monday = 1 and so on */
    var rowDelete = Platform.Function.InsertData('Sunday_Check',['isSunday'],['True']);
else 
    
</script>
  1. In the Automation add Verification Activity to validate "Sunday_Check" Data Extension having Count is greater than 0 then stop the automation
  2. This way, each day you would have a check whether today is Sunday and if it is then the DE would be populated with a record, and the Verification Activity would stop the Automation because of that. On other days, it would simply let the Automation run the next steps.
Source Link
Niko
  • 2.8k
  • 2
  • 10
  • 25

As you mentioned you can either create a separate Automation that would run only on Saturdays or if it is crucial to run everything within one Automation with that specific schedule then you can do that:

  1. Create Data Extension, let's call it "Sunday_Check" with the field "isSunday" (Boolean, nullable);
  2. In your Automation that would have a daily running schedule set as a first step Script Activity:
<script type="javascript" runat="server">
Platform.Load("Core", "1");    

/* Cleans whole Data Extension */
var prox = new Script.Util.WSProxy();
var action = "ClearData";
var props = { CustomerKey: 'xxxx' }; /* Change 'xxxx' to Data Extensions' External Key */
var data = prox.performItem("DataExtension", props, action);

/* Checks if today is Sunday, then add record to DE */
var isSunday = (new Date().getDay());
if( isSunday == 0 )
    var rowDelete = Platform.Function.InsertData('Sunday_Check',['isSunday'],['True']);
else 
    
</script>
  1. In the Automation add Verification Activity to validate "Sunday_Check" Data Extension having Count is greater than 0 then stop the automation
  2. This way, each day you would have a check whether today is Sunday and if it is then the DE would be populated with a record, and the Verification Activity would stop the Automation because of that. On other days, it would simply let the Automation run the next steps.