The ArcGIS Arcade assistant (beta) uses natural language to generate ArcGIS Arcade code. For best results, use clear and plain language and iterate on the responses you receive.
Note:
The assistant is administered at the ArcGIS Online organization level and may be disabled by your administrator.
Use the assistant
To use the assistant, complete the following steps:
- Verify that you are
signed
in to an
ArcGIS Online organization.
You must sign in as a member of a role that includes the privilege to use AI assistants.
The ArcGIS Arcade assistant (beta) in ArcGIS Dashboards supports authoring data expressions and advanced formatting expressions for indicators, lists, and table elements. These dashboard-specific expression profiles can be used to prepare data and customize how information is presented in dashboard elements. For more information about Arcade in ArcGIS Dashboards, see Arcade in dashboards. Arcade is also used in web maps for pop-ups, styles, and labels. For these map-based Arcade workflows, use the ArcGIS Arcade assistant (beta) available in Map Viewer. To learn more about how to use the ArcGIS Arcade assistant (beta) in maps, see Use the ArcGIS Arcade assistant (beta) in Map Maker.
- Use the ArcGIS Arcade assistant (beta) in one of the following ways when authoring Arcade expressions in ArcGIS Dashboards:
- Data expressions—Use the ArcGIS Arcade assistant (beta) when creating or
editing a data expression that serves as a data source for
data-driven dashboard elements. Create your expression on
the Edit data
expression tab, and click the Arcade assistant button
in the side panel. - Advanced formatting
expressions—Use the ArcGIS Arcade assistant (beta) when using advanced formatting with list, indicator,
and table elements. Enable the advanced
formatting option in the list, indicator, and table elements. Open the pop-out
editor icon, and click the Arcade assistant button
in the side
panel.
The Arcade assistant pane appears.
- Data expressions—Use the ArcGIS Arcade assistant (beta) when creating or
editing a data expression that serves as a data source for
data-driven dashboard elements. Create your expression on
the Edit data
expression tab, and click the Arcade assistant button
- Use the assistant by doing either of the following:
- Click a suggestion, and modify it to build a prompt that fits your data.
- In your preferred language, enter a prompt to build an Arcade expression.
- Click Generate to perform your query.
The ArcGIS Arcade assistant (beta) suggests an expression in the Arcade assistant pane.
Tip:
Hover over the Profile context button
to see where the suggested expression will be applied in the layer configuration. - To interact with the suggestion, do any of the following:
- Click Add to editor to add the expression to the expression builder pane.
Tip:
Position your pointer in the expression builder pane where you want the content to be added. For example, in the expression builder pane, move your pointer, and click in front of an existing line of code. When you click Add to editor in the Arcade assistant pane, the suggested expression will be added to the expression builder pane at the position of the pointer.
- Click Replace all code in editor
to replace any existing content in the expression builder pane with the suggested expression. - Click Copy code to clipboard
to copy the suggested expression to the clipboard. - To make adjustments to the prompt, edit the previous prompt in the text area, or copy and paste a previous prompt, and click Refine to submit the modified query.
- To provide feedback on the assistant, click the Helpful button
or Unhelpful button
button and complete the survey. The feedback is used to guide further development.
- Click Add to editor to add the expression to the expression builder pane.
- To clear the query history and start over, click Start over at any time.
Best practices
The following are guidelines that will help you generate Arcade expressions using the ArcGIS Arcade assistant (beta):
- Be clear and concise in your request.
- Avoid ambiguity and vague language.
- While using exact field names is not required, providing sufficient detail is recommended.
Tip:
See the following for an example of a productive prompt versus an unproductive prompt when creating an expression to configure labels:
- Productive prompt: "Display the current value in the middle text. If the value exceeds the target, change the middle text to red; otherwise, display it in green." This prompt is productive because it is clear, concise, and actionable.
- Unproductive prompt: "Format the indicator based on the value." This prompt is unproductive because the assistant doesn't choose how to format values. The assistant only generates expressions based on the author's instructions. The dashboard author should decide what values need to be displayed and how they should be displayed and ask the assistant to generate an expression to accomplish their goal.
Context limitations
Keep in mind the following limitations while using the ArcGIS Arcade assistant (beta):
- The assistant is not a chatbot. It does not remember information you provided in previous prompts. When refining a previous prompt, ensure that you include all relevant details as if you were asking the assistant for the first time.
Tip:
See the following for an example of a productive sequence of prompts versus an unproductive sequence of prompts:
- Productive sequential prompts:
- "Format the VALUE column to display numbers with two decimal places."
- "Format the VALUE column to display numbers with two decimal places. Also, change the cell background color to red when the value exceeds 100." The follow-up prompt retains the original number-formatting requirement while adding the new conditional-formatting requirement. This gives the ArcGIS Arcade assistant (beta) the complete context needed to update the table expression.
- Unproductive sequential prompts:
- "Format the VALUE column to display numbers with two decimal places.”
- "Now make values above 100 red." The follow-up prompt does not restate which column should be formatted, whether red applies to the text or background, or whether the original number formatting should be preserved. This makes the request less precise and can result in an incomplete or unintended expression.
- Productive sequential prompts:
- The assistant is not aware of any previously generated Arcade expressions or existing expressions in the Arcade editor or web map.
Tip:
See the following for an example of a productive prompt versus an unproductive prompt:
- Productive prompt: "Simplify this expression: <insert expression here>." This prompt is productive because the user has provided enough context for the assistant to be able to generate an expression.
- Unproductive prompt: "Simplify the expression in the editor." This prompt is unproductive because the assistant is unaware of the expression in the editor.
- The assistant does not query your data. For this reason, it is not aware of specific data values present in the layer for which you are generating the expression. If you want the assistant to write conditional logic based on data values, you must provide those in your prompt or allow the large language model to assume the values.
Tip:
See the following for an example of a productive prompt versus an unproductive prompt:
- Productive prompt: "If the score is above 100, return ‘good’. If it is above 75, return ‘moderate’. If it is between 20-75, return ‘bad’. If it is below 20, return ‘horrible’." This prompt is productive because the values are specific and the categories are defined.
- Unproductive prompt: "Break up the score field into multiple categories using natural breaks: ‘good’, ‘moderate’, ‘bad’, ‘horrible’.” This prompt is unproductive because the assistant does not know the range of values to categorize.
- You cannot use the assistant to search, reference, or query other layers in the map. The only context the assistant has is field names and aliases for the layer running the expression. Additionally, the assistant is unaware of attachments and related tables that may be associated with the layer. For this reason, there is limited support for generating expressions using FeatureSet functions. If you want to access data from other layers, provide the layer title or item ID for the assistant to know which information to include in the expression. If this information is not provided, the assistant will generate a title or ID that you will need to manually replace when the generated expression is added to the expression builder pane.
Tip:
See the following for an example of a productive prompt versus an unproductive prompt:
- Productive prompt: "Create a data expression that returns the average water temperature for each waterbody type from the Water Quality layer. Use the Waterbody Type field for grouping and the WaterTemp field to calculate the average." This prompt is productive because it identifies the layer, the fields to use, the required grouping, and the statistic to calculate.
- Unproductive prompt: "Return the average temperature for each waterbody type." This prompt is unproductive because it does not specify which layer contains the data or which fields should be used.