This recipe will calculate a new fact field from two (or more) existing facts. This specific recipe guide will calculate an Expiration Date from a Term(months) and Effective Date.
What you'll need:
Time Required: 20 minutes
Skill Level: Intermediate
- Permission to edit facts in your Thomson Reuters Document Intelligence Workspace
Create a new Recipe:
- Navigate to Document Intelligence Automate and select 'Create Recipe'
- Name the Recipe, select the Location (it should default to the project that was open), and select 'Trigger from an app'. Then click 'Start Building'
Build a Recipe:
- Select 'Thomson Reuters Document Intelligence - User' as the app for the Trigger step. Select an existing connection, or select Create Connection. Enter in the same credentials that are used to sign into the Thomson Reuters Document Intelligence Platform.
- For the Change Type field, select 'Fact Created', 'Fact Field Added', and 'Fact Field Changed'. For Fact Values, select the 2 Facts that are going to be used for the calculation. For this recipe, Term(Months) and Effective Date. This ensures the recipe will only trigger when one of the 2 fields needed for the calculation are changed or added.
- Add a new action and select 'Thomson Reuters Document Intelligence - User' as the app. Choose 'List Facts' as the action.
- Add the Document ID Data Pill from the Trigger action to the Document ID field. For Facts, select the 2 facts needed to calculate (in this case, Term and Effective Date) and the fact where the calculation will be added(for this example, Expiration Date).
- Add a new action and select 'IF Condition'
- For Data Field, add 'Term' and for the Condition, select 'is present'.
- Select the '+' icon to add another condition and select 'AND'. For the Data Field, enter 'Effective Date' and for the Condition select, 'is present'. This step ensures that all of the necessary fields for the calculation are present. If the necessary fields are not present, the recipe will end.
- Add a new action and select the 'IF Else' action.
- For the condition of Line 4: set Data field to Expiration Date and Condition to 'is not present'. This will check to see if the 'Expiration Date' fact exists or not. If it does not exist, the recipe will add a new fact. If it does exist, the recipe will remove the old fact and add a new one.
- Follow the 'Yes' path and add an action using the 'Thomson Reuters Document Intelligence - User' app and 'Add facts' as the action.
- For the Document ID field, add the Document ID Data Pill from the Trigger action. For Facts, select 'Expiration Date' (or whatever fact you would like to add)
- In the Expiration Date field, toggle the field to use a 'formula'
- In the formula, Term and Effective Date need to be added together. Select the data pill for Effective Date from the output of action #2
- Then add a plus sign (+) and select the Term from the output of action #2. For the formula to work, there are some things that have to be done to the Term value in this case. It needs to be declared as a number and also tell TT Automate that it is measured in months. Add ".to_i.months" after the term Data Pill. It should look similar to the screenshot below:
- Next, below the 'ELSE' block (should be on line 6) add a new action (Line 7). Use 'Thomson Reuters Document Intelligence - User' as the app and select 'Delete Facts' as the action.
- In the Document ID field, add the Document ID Data Pill from the Trigger action, and in Facts, select Expiration Date. This will delete any Expiration Date facts on this document.
- Go to the previous 'Add Facts' action, right-click, and select 'Copy'
- Hover below the 'Delete facts' action and select 'Paste'
That's it! Run some tests on your recipe to ensure it delivers the desired results.
NOTE: When this is turned on, it will listen and take action on any documents you have access to. If you need to limit what documents this will take action on, additional rules can be added to the Trigger to be more selective or more conditions added to Line 3 to stop the recipe.
- Update a status or workflow fact when this is successful
- Send another notification if the expiration date is within a certain number of days/months
Please sign in to leave a comment.