What it does
Agent scripts are ordered step lists that appear in the productivity pane and walk an agent through a call or case in the order the business wants it done. Macros are sequences of automated actions — open a form, pre-fill fields, send an email, resolve a case, refresh a tab — that a script step or a pane button can fire in one click. They are the two halves of the same productivity tooling, and they only make sense together.
Key facts
- Two security roles do the work: Productivity tools administrator to build scripts and macros, Productivity tools user for the agents who run them.
- Script steps have three action types: Text (an instruction shown to the agent), Macro (runs a macro), and Script (calls another script, so you can compose them).
- Each step has an Order value that drives display sequence, and a Name shown at runtime which accepts slugs —
Hi {customerName}works. - Scripts are language-specific; you pick an enabled Dataverse language on the script record, so a bilingual deployment means parallel script sets.
- Scripts attach to session templates on the template's Scripts tab. Turning on Enable build expression lets you pick the default script conditionally at runtime through the expression builder.
- Macros are built in a Power Automate-style designer inside the admin centre and must begin with the Start macro execution step. Miss it and the macro fails.
- Four connectors are available in macros: Productivity automation (model-driven app actions such as open record, update record, resolve case, search knowledge base), Session connector (get tab id, refresh tab, set focus), Omnichannel connector (link and unlink records to a conversation), and Flow connector to call a Power Automate cloud flow.
- Context reaches macros through slugs —
${anchor.incidentid},${anchor.ticketnumber},${customerName},${queueId},${Session.CurrentTab.entityId}— resolved from browser memory at run time. - OData slugs pull from related records, for example
${$odata.contact.emailaddress1.?$filter=contactid eq '{anchor._customerid_value}'}. - Macros can be run from the productivity pane or invoked programmatically with the
runmacromethod. - Out-of-the-box smart assist case and knowledge suggestions stopped being supported on 2 June 2025. Smart assist now means a custom Azure Bot Service agent; Copilot Studio agents are explicitly not supported as smart assist agents.
- Productivity tools are not available in Omnichannel for Customer Service on Unified Service Desk.
When to use / skip
Scripts are worth building where the business genuinely has a script — regulated verification, complaints handling, anything with a compliance step someone has to be able to prove happened. They're wasted on experienced agents doing discretionary work, who will collapse the pane on day two. Macros are more universally useful and much easier to justify: any three-click sequence an agent does forty times a day is a candidate. If you have to pick one, build the macros and leave scripts until the client asks. Two macros that remove real clicks beat a twelve-step script nobody follows.
Configuration decisions
- Which processes actually need a script, and whether it's guidance or a compliance record. If it's compliance, the script alone doesn't record anything — you need a macro or a field update to capture the fact.
- Fixed default script per session template versus the expression builder. Conditional selection is powerful and adds a debugging surface.
- Whether macros stay inside the productivity automation connector or reach out to Power Automate. Cloud flows bring their own licensing and latency.
- Slug versus OData for context. OData round-trips at run time, so a macro with three OData slugs feels slow in a live call.
- Whether script steps call macros directly or agents run macros independently from the pane.
- Language coverage, and who owns keeping parallel script sets aligned when the wording changes.
Gotchas
- A macro that fails part way through does not roll back. Half-completed records are the normal failure mode, and the agent sees a generic error.
- Slugs resolve against the anchor record only. A macro fired from a non-anchor tab that assumes
${anchor.*}will pick up the wrong record or nothing at all. - Missing the Start macro execution step gives a failure with no useful message. Always check it first when a new macro doesn't run.
- Agents without Productivity tools user see the pane without the tools. It reads as a broken deployment rather than a permissions issue.
- The June 2025 removal of out-of-the-box smart assist suggestions surprises clients who saw a demo recorded earlier. Similar cases and knowledge suggestions now come from Copilot or from your own bot, not from smart assist.
- Scripts in the out-of-the-box workspace profile are unavailable — you need a custom experience profile before agents see the control at all.
- Macro error handling is limited, so anything involving an external system should go through a cloud flow where you can at least log the failure.
Consultant notes
- Build one macro in the first sprint and put it in front of agents. It's the cheapest credibility you'll buy on the project.
- Ask the client to time the manual sequence before you automate it. The business case writes itself and it stops you automating something done twice a week.
- Warn the client that scripts need an owner in the business. Scripts nobody maintains become wrong within two releases and agents learn to ignore them.
- Test every macro on the unhappy path — missing customer, no email address, case already resolved — because that's where agents will run it.
- Check the smart assist story explicitly if the client's requirements mention similar-case suggestions; that conversation now belongs with Copilot, not here.
Worth revisiting when the macro designer picks up better error handling, or if smart assist's supported agent types change again.