The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Must-read

Choosing between HXL widgets and assistant rendering for AI tool results (opens in a new tab)

You will learn when to let an AI assistant render a Salesforce tool result and when to ship a Headless Experience Layer widget, and what a widget can and cannot show.

Why read this

The piece gives a worked approval-request example and the wiring needed for each assistant.

Let the assistant render

  • Answers exploratory questions
  • Layout can vary each run
  • Charts drawn from tool results
  • No build beyond the tool

Ship an HXL widget

  • Fixed field order and grouping
  • Buttons send decisions back
  • Built once for all assistants
  • No chart component in beta
Assistant rendering suits open questions; widgets suit fixed layouts

The article contrasts two ways of presenting a Salesforce action’s result to users of AI assistants. By default, the assistant reads a JSON tool result from an MCP server and decides for itself what to emphasize and how to lay it out. The Headless Experience Layer, part of the Headless Toolkit, lets you define an interface once as a structured widget that assistants such as Claude, ChatGPT and Slackbot render natively. HXL is currently in beta across Agentforce employee agents in Lightning Experience, ChatGPT, Claude and Slackbot.

The authors set out a decision rule. Where users work on a Lightning Record Page or in a console app and do not ask an assistant for results, skip HXL and use standard page components, or a Lightning Web Component when those fall short. Where users ask for results in an assistant, let the assistant render the answer for exploratory questions, but ship a widget when the placement of fields, their grouping, labels and buttons matter. Their example is a sales manager approving discounts in Slackbot: a widget keeps the requested discount beside the policy limit with Approve and Reject buttons, whereas an assistant might reorder or omit the policy limit from one reply to the next.

On cost, the article argues that one widget replaces separate builds for each surface, such as a Lightning Web Component for Agentforce and a Block Kit message for Slack, so the investment pays off as the number of assistants grows. A widget is metadata-defined, composed in JSON from 22 HXL components such as rows, tables, badges, links, callouts and buttons, and is previewed with mock data in the HXL Playground. It connects to data through custom Lightning types that map an action’s output fields to widget attributes. For Agentforce you select the type as the action’s output rendering. For Slackbot, ChatGPT and Claude you attach the widget to a tool on a custom MCP server, which currently works only for invocable actions.

The limits matter as much as the method. The beta widget set has no chart component, so charts should be left to the assistant, or drawn with a Lightning Web Component when the user works in Lightning Experience. Interactive modelling, such as adjusting a discount and watching margin change, belongs on the record page rather than in a chat.

Read the original at Salesforce Architects (opens in a new tab)

Worth reading?

Recommended

Exposing HXL widgets to Slackbot through a custom MCP server (opens in a new tab)

You will learn what a custom MCP server needs before Slackbot can render HXL widgets, how to connect Slack through the Salesforce Org Connection, and how to set tool permissions and descriptions so the right tool is chosen.

Why read this

You will also see how to troubleshoot a missing card.

  1. Check the MCP server definition
  2. Map users by Federation ID
  3. Request and approve the org connection
  4. Add the MCP server in Slack admin
  5. Turn on the server and set tool permissions
Steps to make an HXL widget appear in Slackbot, in the order the article gives them

The article explains how to make an existing HXL widget appear in Slackbot. If a widget already renders in Claude or ChatGPT, it can render in Slackbot without changes to the widget, the Apex action or the Custom Lightning Types. The remaining work is configuration: deciding how Slack connects to the Salesforce MCP server, who can use it, and which tools Slackbot may run. The author uses the Pronto sample app to show a storefront card and a follow-up menu card.

Before connecting, the server must be active, every resource needs a description, each tool’s uiResource must match a resourceName, and each tool’s readOnly and destructive flags must be set. Slackbot treats unclassified tools as write tools, which adds confirmation prompts. The connection itself is made through the Salesforce Org Connection: users are mapped by Federation ID, the org is requested and approved from Slack and Setup, and the MCP server is added in Slack admin and confirmed by a Date added value.

Each user then turns on the server in Slackbot and approves tools, choosing Allow once, Always allow or Deny per tool. Two limits apply: up to five active servers per user, and a 60-second timeout per call, with stateless calls that rerun the Apex action, so calls should stay small. Overlapping tools on other servers or Slackbot’s own Salesforce search can cause a plain table instead of the card, so descriptions should be specific.

The troubleshooting section maps common symptoms, such as plain text, missing tools, or blank values, to causes and fixes. Testing with a debugging tool like MCP Inspector helps separate server definition problems from Slack problems.

Read the original at Salesforce Developers Blog (opens in a new tab)

Also told by InfallibleTechie (opens in a new tab)

Worth reading?