Trigger a rule by case status
You can pull data from a CXM case into your form, and use this to decide whether to fire a particular rule.
Example: Only fire rule if is case status is 'Awaiting Renewal'
We have created a form in XFP for renewing a subscription. The subscription in question is managed by a CXM case. The form will run a transition action on the CXM case when it is submitted.
To prevent issues, we only want to run the transition action if the case status is 'Awaiting Renewal'. We can do this by creating a logic to get the case status, and then checking this in our rule.
Step 1: Create a logic formula
In your form, click Advanced > Logic in the top navigation bar (under the the form title).
Click Add Logic.
You will be taken to the logic designer, where you can build your logic.
Give your logic a name, 'Current Case Status'.
Choose Predefined as the type.
Choose CXM - Status of a specific case from the appearing list.
Set the inputs to the formula. CXM Case Reference will be our case reference form question. Leave Run as signed in user set to 'Yes'.
Click Save to create the logic.
Step 2: Use the logic as a rule condition
In your form, click Rules in the top navigation bar (under the the form title).
Open the rule responsible for transitioning the case.
Add an And block to this rule.
For this condition, choose Logic, select your formula, and then is equal to 'Awaiting Renewal'.
Test the form - the rule will only run if the case is 'Awaiting Renewal'.