After reviewing a Case, an agent may need to schedule a follow-up task or record a phone call. Activities should be linked to the Case through the Regarding relationship.
1. Task creation
Add subject, due date, and optional description controls. Create the task using the Tasks data source and the supported Regarding lookup record.
IfError(
Patch(
Tasks,
Defaults(Tasks),
{
Subject: Trim(txtTaskSubject.Text),
Description: txtTaskDescription.Text,
'Due Date': dpDueDate.SelectedDate,
Regarding: varSelectedCase
}
),
Notify("Task creation failed: " & FirstError.Message, NotificationType.Error),
Notify("Follow-up task created.", NotificationType.Success)
)
Confirm the activity table’s displayed field names and Regarding relationship in your environment. The formula is a pattern, not a universal schema contract.
2. Phone call activity
For a phone call, capture subject, direction, phone number, and notes. Populate the Regarding field with the selected Case and set the appropriate direction value using the connector’s choice metadata.
3. Prevent duplicate submissions
Use a saving variable to disable the submit button while Patch is running. Reset the form only after a successful save, and preserve entered values when the operation fails so the agent can retry.
