The Studio for a custom visual has an assistant column, the Custom Visual AI panel, that writes and edits the visual's code for you. Use it to start a visual from a description, rework code you already have, or fix something a check has flagged; every change it makes lands in the editor for you to review first. If you are new to custom visuals, start with Custom visuals and the visual library.
Ask the assistant to write the code
Open the tile's Studio from Edit code. The assistant column sits on the right; it is open by default when you may use it, and the Studio remembers whether you keep it open. While it loads, the column reads Loading assistant.
Describe what the visual should do: the fields to show, the way it should look, and anything to avoid. The assistant reads the tile before it writes, so it starts from its code, fields and data.
Read the reply and the steps it took. Each step appears as its own card under the reply; how each card reads is explained in Building custom visuals with the assistant.
Review the change in the editor, then choose Apply or press Ctrl+Enter. Apply puts the code on the tile; saving the report shares it.
The conversation is attached to the tile it was opened from, or to the library visual when you opened it from the library's Edit code; it cannot edit anything else. The Report Builder can also hand a tile over to Custom Visual AI as part of a job; see Limits and refusals.
What the assistant can do
Read the tile. It reads the current source with line numbers, the source tier and libraries, its data roles, bindings, options and interaction settings, the size it renders at, and a profile of the bound fields: their types, ranges, null rate and a few sample values. It can also list the visual's assets, including files the code references that are not uploaded yet.
Start from an example. It can fetch a worked example to build from, such as one of the built-in library visuals or a small KPI strip template. Examples need no open Studio and do not count against the operation budget.
Write the code. It can replace whole files, patch a passage by search and replace, or replace a range of lines, in either source tier, Template or HTML + JS. visual.js exists only on the HTML + JS tier, and libraries are named by library and major version, such as d3@7; the list is on Custom visual SDK.
Set fields and behaviour. It can declare data roles and bind the tile's fields to them, change the visual's options, and change interactions such as selection and link opening. Options it adds appear as controls in the options panel.
Check its work. Every write runs the same authoring checks and size caps as hand-written code, and files the code references are attached to the visual automatically. A write that breaks a rule comes back as a refusal with the reason, and nothing changes.
Its tools cannot add a field to the Data well, upload or delete asset files, or save or publish the visual.
How it edits the code
Patch by exact match. A patch finds its text byte for byte, whitespace included, and expects it exactly as many times as it declares, once by default. When the text is not found the way it expects, nothing changes and the step's card reads No change:.
Replace a range of lines. The line numbers come from the last read of the file. After an edit, the lines below the range shift, so the file is read again before more lines are addressed; a range outside the file is refused.
Write whole files. A full write sends whole files, and a visual that already has a source is not overwritten by accident. Each part must stay under its cap: visual.html 96 KiB, visual.css 64 KiB, visual.js 128 KiB, and 256 KiB for all parts together.
Patches to the same file apply in the order they are sent, and several files can change in one turn.
Roles, fields and options
Roles and fields. The assistant declares up to 16 data roles, each taking up to 8 fields, and binds the fields already in the tile's Data well to them. It never adds a field to the well itself: when the code needs a field that is not bound, it names one from the fields the report offers and asks you to drag it in, then continues once it is bound. See Custom visual options, data and limits.
Options. Options values are plain JSON: no functions, and no colour literals. A colour is stored as a theme token name, such as accent or chart-3, and the code resolves it, so the visual follows the report's theme. By default, the values it writes merge over the ones already there.
A write lands in the editor as a change you have not applied; the tile updates only when you choose Apply. See The custom visual Studio for the apply and save flow.
While a turn runs, the code is locked: the editor is read-only and shows AI is editing - the editor is read-only until the turn finishes. Apply, undo and redo wait until the turn finishes.
The assistant works from the applied code. With edits in the editor that you have not applied, it shows You have unapplied edits; the AI works from the applied code; apply your edits first if you want it to build on them.
Code the assistant wrote is tagged as AI-made. In the Studio's version history, a version whose code the assistant wrote carries the Mind origin chip; your own edits read You, and a restored earlier version reads Restored.
Previews the assistant can run
A preview renders once, at one of three sizes: tile, wide or narrow.
It draws from one of three datasets: your live rows (up to 200 for a preview), an empty dataset, or a hostile dataset that swaps values for awkward ones, such as long text, odd numbers, empty values and text that looks like code, to see how the code copes.
A successful render can be attached to the conversation as a small picture: a JPEG no more than 1024 pixels on its long edge.
The preview reports how the run went, including a render that failed, stopped, could not start or timed out. The chips and the report on the preview card are explained in Building custom visuals with the assistant.
What the checks look for
Static rules: forbidden browser calls, addresses outside the sandbox allowlist, missing readiness calls, fixed colours instead of theme tokens, and code that looks like it asks for a password. The rule list is on Sandbox, network and the allowlist.
Render checks, from the last run of the code: whether anything was painted for the rows it got, whether the content overflows the tile, render errors, and resources the sandbox blocked.
Numbers on screen must come from the data. A number shown as fixed text that no row and no option supplies is flagged, so you can derive it from the rows or the options instead.
Findings come back worst first. Each carries a code, a severity (error or warning), the file and line where known, the measured value and a suggested fix.
After a failed preview or a check with errors, the assistant repairs the code and runs again, at most three automatic repair rounds in one turn. It then stops and reports the last error, and a Try to fix again chip is offered.
Limits and refusals
A refused or timed-out step never changes the visual: no part of it is applied, the tile keeps the code it had, and the reply says why.
No Studio open. An edit travels from the conversation to the Studio tab that holds your tile. When no Studio is connected, the assistant cannot reach the code: open the tile in the Studio with the Custom Visual AI panel open and ask again.
A round the Report Builder asked for. When the Report Builder hands a tile over, the round reaches the code only while that tile's Studio is open. The Job view says so in amber, Custom Visual AI reads this in the visual studio, which must be open on the tile., and the hand-off waits with the state Custom Visual AI is waiting for the tab.
Permissions. Every step re-checks that you hold Use DataPrism AI and Author DataPrism Custom Visuals, that the report is one you can edit, and that you are not acting as another user. For a library visual, you must own it or hold Manage DataPrism Organization Visuals instead of editing a report. See Who can do what in DataPrism.
Custom visuals switched off. When custom visuals are off for the deployment, requests read DataPrism Custom Visuals is disabled on this deployment. Ask an administrator to enable them.
The 20-second deadline. The Studio must answer each step, and a preview must finish, within about 20 seconds; a step that misses it reports a timeout and is not applied.
The 60-operation budget. One turn can make at most 60 operations on one visual, and reads count as operations. Past the limit, the turn sums up what is left and asks you to continue in a new message; the next turn has a fresh budget.
A stop or a closed tab. If you stop the turn or close the Studio, the operation in flight is not applied. Steps that finished before it stay in the editor as unapplied edits.
How much one step returns. A field profile keeps up to three sample values per field. A check shows up to 40 findings, or up to 200 when a fuller list is asked for, with the true total; field suggestions return up to 8 by default and up to 40. One result carries at most three preview pictures.
Start from a chart you already have
When a native chart is converted into a custom visual, the assistant's first turn comes seeded: it receives the chart's configuration, the fields it used, and, when the chart could be captured, a picture of how it renders today. Ask it to improve the visual from there. The conversion itself is described in Convert a chart to a custom visual.
Questions, answered
Who can use the assistant while building a custom visual?
You need the DataPrism Custom Visual Author permission, which also brings Use DataPrism AI, and edit access to the report. Without it the assistant column is not available; ask an administrator to add the permission to your role. See Who can do what in DataPrism.
Do the assistant's changes go straight onto the tile?
No. Every change lands in the editor as an unapplied edit, and the tile changes only when you choose Apply; saving the report then shares it. See The custom visual Studio for the apply and save flow.
The banner says the AI works from the applied code. What does that mean?
The assistant reads the code applied to the tile, not edits still sitting in the editor. With unapplied edits you see You have unapplied edits; the AI works from the applied code. Apply your edits first if you want the assistant to build on them.
Why did the assistant say the visual studio is not connected?
An edit travels from the conversation to the Studio tab that holds your tile, so it needs a live Studio connection. Open the tile in the Studio with the Custom Visual AI panel open and ask again.
The assistant asked me to drag a field onto the tile. Why can it not add it itself?
The assistant never changes the report's fields; it only binds the fields already in the tile's Data well to the visual's data roles. When the code needs another field, it names one from the fields the report offers and you drag it in; the assistant continues once the field is bound.
Is there a limit to how much the assistant can change in one turn?
Yes. One turn can make at most 60 operations on one visual, and reads count too; fetching a worked example does not. When a turn reaches the limit, it asks you to continue in a new message, and the next turn has a fresh budget, so split a large rework across a few messages.
The assistant reported a timeout. Was anything changed?
No. The Studio must answer a step, and a preview must finish, within about 20 seconds; a step that misses it fails and no part of it is applied. Ask again and it makes a fresh attempt.
I stopped the assistant's turn or closed the Studio. What happens to what it already did?
The operation that was in flight is not applied. Steps that finished earlier stay in the editor as unapplied edits, so review them before you apply.
What is a hostile data preview for?
It replaces your rows with awkward values: long text, odd numbers, empty values and text that looks like code. It shows how the visual copes with messy data that tidy demo rows hide. Ask for a hostile preview when you want to stress the code.
Why does the assistant keep colours out of the visual's options?
Options values hold no colour literals. The assistant stores a theme token name instead, such as accent or chart-3, and your code resolves it with the theme, so the visual follows the report's style. See Custom visual options, data and limits.
Why can the assistant not edit while I impersonate another user?
Custom visual authoring is refused while you act as another user: each step re-checks the two permissions and your edit access to the report, and impersonation fails that check. End the session and open the tile's Studio again. See Impersonate a user.
The Report Builder handed a tile to Custom Visual AI. Why is nothing happening?
A round the Report Builder hands over reaches the code only while that tile's Studio is open. The Job view says so in amber, Custom Visual AI reads this in the visual studio, which must be open on the tile., and the hand-off waits with the state Custom Visual AI is waiting for the tab until you open it.