Case management · Part 4 of 7
Wire it with a recipe
Create a recipe on the Case table that validates new cases before they are saved and routes them in the background afterwards.
What you’ll build
Section titled “What you’ll build”So far your logic runs only when you select Run. In this part you create the Case rules recipe, which binds it to the Case table. When an agent creates a case, the recipe first runs the New case checks validation set: if any rule fails, the save is cancelled and the agent sees every failed rule. Once the case is saved, the recipe runs the Route new case flow in the background, so the agent does not wait for the assignment and the email. Then you try it end to end in your service app.
Before you begin
Section titled “Before you begin”Complete Part 3: Automate with a logic flow. You need the New case checks validation set from part 2 and the Route new case flow. The project’s solution, ContosoService, must be unmanaged: a recipe cannot be created in a project whose solution is managed.
Create the recipe
Section titled “Create the recipe”-
Go to Logic FabricLogicLogic Recipes and select New.
-
Enter
Case rulesas the Name and choose theCase ManagementProject. -
Under Which table does this recipe react to?, search for
caseand choose the Case table. The table is fixed once the recipe is saved. -
On the Create card, use Select Properties to make these columns available to the logic: Case, Case Title, Case Type and Description.
Validate before the case is saved
Section titled “Validate before the case is saved”-
In stage 1 Validation of the Create card, select Add validation.
-
Choose
New case checksas the Validation Logic Block. -
Map its Inputs to the new record’s columns:
Input Column TitleCase Title CaseTypeCase Type DescriptionDescription -
Leave Applies When: empty, so every new case is checked, and select Save.
The row appears in the stage with a Logic block chip and the card header counts it, for example “Validation 1 · Before 0 · After 0”.
Route the case after it is saved
Section titled “Route the case after it is saved”-
In stage 3 After Create, select Add action.
-
Set Action Type to Flow and choose
Route new case. -
Map the input
Caseto the new record’s Case column. -
Set Async to Yes. The flow then runs in the background after the case is saved, and the row shows a Background chip.
-
Leave Applies When: empty and select Save.
-
Save the recipe. If the form shows “Logic Recipe: Resolve all validation errors.”, open the item the editor marks and complete it.
Running the flow in After Create with Async on has two benefits. The agent’s save is not slowed down by the email, and the flow does not run inside the save’s transaction, so its Try / Catch can handle an email failure as you designed in part 3.
Test it on a real case
Section titled “Test it on a real case”-
In your service app, create a case with the Case Title
Router drops connectionand a Customer. Leave Case Type empty and typeBrokenin Description. -
Save. The save is cancelled and the message lists, one per line:
Choose a case typeDescribe the problem in at least 20 characters -
Set Case Type to Problem, enter
The router restarts every evening at 19:00.as Description, set Priority to Normal and save. The case is saved. -
Wait a moment and refresh the case. Owner changes to
Service Triage, and the timeline shows the notification email and the Triage notification note. -
Check that the email’s due date is three working days after the case’s Created On.
If the case is saved but the owner does not change after a few minutes, the flow failed in the background, where the agent does not see the error. Run Route new case on the same case from the Run dialog: the result shows the error, so you can fix the cause.
Check your work
Section titled “Check your work”- A new case with missing information is refused, and the agent sees every failing rule at once.
- A complete case is saved immediately, and shortly afterwards it is owned by
Service Triage, has a notification email and a note. - The recipe’s Create card header reads “Validation 1 · Before 0 · After 1”.
To stop the recipe while you experiment, set Disabled to Yes on the recipe form; set it back to No to turn it on again.
Continue with Part 5: Orchestrate the escalation, where a business process tracks triage, sends high-priority cases to a parallel review and escalates overdue cases.