Views:

Scenario Overview


In this scenario we will demonstrate how to quickly and easily extend an existing Decision Table to add in new Conditions and Actions as business requirements changes.

For this article it is assumed that you have at least basic familiarity with Decision Tables and/or have read the following articles:

We will extend the Credit Card Decision Table that we previously created here.

Additional Requirements


The following requirements must be added into the Decision Table:

Additional Rule 1
The customer must be over 18 to be eligible for a Credit Card
Additional Rule 2
If the customer's Annual Income is over €200,000 then we want to trigger an existing workflow
to send them extra paperwork

 

Adding the Age Condition


Open the existing Decision Table and change to the Calculations table by clicking on the Calculations tab at the base of the Decision Table.

 


                                                                                        
We set the Calculation Name as Age (you can call this whatever you like, but make sure it is meaningful for someone reading the Decision Table).

The calculation formula is entered as you would any standard North52 Formula:

Click on cell B2, then click on the Functions tab and expand the Date node and click on the DateDiff() function.  

This will put the DateDiff function template into cell B2.  


Click on cell B2 again and the formula will appear in the command editing bar 
    
Now delete the 'fromdate' from the formula until you are left with DateDiff( , 'todate', 'interval')
Place the cursor before the the comma and click on the Source tab and expand the Source node and select theBirthday field. 

This will place [contact.birthday] into the formula.




Now repeat the procedure for the 'todate' and replace it with the function Utcdate() and finally replace 'interval' with 'y' 

This formula will now return the age in years of the Primary Contact on the Account record.

To add this as a Condition on the Decision Table:

  • Click back to the Decision Table, by clicking the Decision Table tab at the bottom of the editor
  • Add a new Condition column if needed
  • Click on the yellow cell under Condition
  • Click on the Source tab on from the configuration pane
  • Expand the Calculations node and Age should appear there (or whatever you named your calculation)
  • Click Age

Age should now appear in bold text for the Condition. As the requirement is that everyone must be over 18 before they can be eligible for the Platinum card we enter >18 into cell A4 and then drag the value down to all the other cells in that column.




The additional requirement has now been added to the Decision Table.

Adding the extra Action


Next we will need to add the requirement to send additional paperwork to customers if their Annual Income is greater than €200,000.

To do this we open the Actions table by clicking on the Actions tab at the base of the Decision Table. Similar to the Conditions table we will need to set an Action Name and an Action Value.

Again it is always a good idea to make your Action name meaningful to other people who may be reading your Decision Table.

We will use SendHighIncomePaperwork as the name in cell A2.

In cell B3 we will define the formula. This time we will use the ExecuteWorkflow() function to trigger an already existing workflow that will send the paperwork to the customer via email.

Click on the Functions tab on the configuration panel and expand the Platform Operations node. Click on ExecuteWorkflow and it will appear in cell B2.



We now delete 'workflowname' from B2 and click on the Source tab, expand the Processes node and then the Workflows sub-node.

Click on the name of the required workflow to add it into the formula.


   Next we delete 'recordid' and replace it with [contact.contactid] by expanding the Source node and clicking on Contact


To add this as a Action on the Decision Table:

  • Click back to the Decision Table, by clicking the DecisionTable tab at the bottom of the editor
  • Add a new Action column
  • Click on the cell F13 to add the Action there
  • Click on the Source tab on the configuration pane
  • Expand the Actions node and SendHighIncomePaperwork should appear there (or whatever you named your action)
  • Click SendHighIncomePaperwork which will be transferred to cell F13 

The requirement was to send the additional paperwork to all customers who qualify for the Platinum Credit Card if their Annual Income is over €200,000 so we will drag down to copy the {SendHighIncomePaperwork} value into cells F14 and F15.




The Decision Table has now been extended to make sure the customers are over 18 years of age and to send the additional paperwork to customers with an annual income over €200,000.

Note 1 : 

For this Decision Table 

  • Exit on First Match is enabled.
  • The SendPaperwork workflow was previously configured.