In this article
Post Scripts are actions that are executed after all other actions are performed. Typical examples can be when information is written in the Log Window for checking purposes or sending via email. You could have in your Post script section the following expression:
var l1 = noAgeCounter + " respondents have not answered Age.";
AddLogMessage (l1);
This expression would log the content of noAgeCounter. You would use noAgeCounter in Scripts as :
if (IsNull ("q4"))
{
++noAgeCounter;
}In this example noAgeCounter would increment each time q4 is not answered. When executing the rule the entry would be displayed as below:
(8:25:06 AM) Initiating task: Rule Executor
(8:25:35 AM) 9 respondents have not answered Age.
Another example for a Post Script is the sending of emails. This could be achieved using the following expression:
SendMail("myemail@myemail.com", "youremail@youremail.com", "Subject: Rule Result", "Body: \r\n" + l1 + "\r\n" + l2);