संपादित करें

इसके माध्यम से साझा किया गया


Review macro run history

Applies to: Dynamics 365 Contact Center—standalone and Dynamics 365 Customer Service only

You can view the macro run history, which shows how many times a macro ran, along with the success or fail status. When you select a macro that failed, you can view the exact action step at which the failure occurred, allowing you to identify why the failures occurred.

View macro run history

Consider the following script step that fails.

Script failing.

To view the run history for the macro that failed, follow these steps:

  1. Go to Copilot Service admin center, select Productivity > Scripts.
  2. On the scripts page, select the required script.
  3. In the list of Scripts steps, open the required target Script step.
  4. In the Target macro, select the macro.
  5. Select View history. Each record in the list represents a macro run.
  6. Open the macro that failed and identify the step that failed.

In certain scenarios, a step fails because a previous step has set values incorrectly or has missing values. Select a step from the macro history to review your macro actions, attribute names, and attribute values.

View the run history for a macro.

Review session context variables

You can review the macro run history to validate if the session context variables are configured correctly in the macro design. You can also validate if the session context variable is correct and returning the expected value using the Microsoft.Apm APIs.

  1. Open Copilot Service workspace.
  2. Open a session that triggers a macro run. For example, open a case from the Home session.
  3. Press the F12 key to open the developer tools window.
  4. In the console window, specify the following command and press Enter: Microsoft.Apm.getFocusedSession().resolveSlug("{anchor.title")
  5. Replace the session variable based on your preference. Remove the $ sign typically used in the macro designer.

Review the results in the browser console.

Use lookups and session context

You can use multiple patterns to configure lookup based on the macros you want to use. You can review the patterns from the following examples and replace the session context variable based on your requirement.

  • For macros that populate form fields, such as Autofill form fields, you can use the following patterns:

    • lookup fields:
      • Attribute name: regardingobjectid
      • Attribute value: [{"id": "${anchor.incidentid}","name": "${anchor.title}","entitytype": "incident"}]
    • activity party fields:
      • Attribute name: to
      • Attribute value: [ {"id":"${anchor._customerid_value}","type":"${anchor._customerid_value@Microsoft.Dynamics.CRM.lookuplogicalname}","name":"${anchor._customerid_value@OData.Community.Display.V1.FormattedValue}"}, {"id":"${anchor._cr27b_secondarycontact_value}","type":"contact","name":"${anchor._cr27b_secondarycontact_value@OData.Community.Display.V1.FormattedValue}"}]
  • For macros that open forms by prepopulating the field such as Open a new form to create a record, you can use the following patterns for lookup:

    • Attribute name: regardingobjectid
    • Attribute value: ${anchor.incidentid}
    • Attribute name: regardingobjectidtype
    • Attribute value: incident
    • Attribute name: regardingobjectidname
    • Attribute value:${anchor.title}
  • For macros that updates records such as Updating an existing record, you can use the following pattern for lookups:

    • Attribute name: regardingobjectid_incident@odata.bind
    • Attribute value: /incidents(${anchor.incidentid})

Macro run reports

Macro runs are logged in the Macro Run History (msdyn_macrosession) table table. You can use this table to create reports that capture metrics such as macro usage in a given time frame or success and failure rate.