The Arcade assistant (beta) uses artificial intelligence (AI) to generate ArcGIS Arcade expressions from instructions you type in natural language. For best results, use clear and plain language and iterate on the responses you receive.
Experience Builder supports using Arcade to add data and to apply advanced formatting to widgets and list items. In all cases, you enter scripts in an Arcade editor that includes the Arcade assistant (beta).
Note:
The assistant is administered at the organization level and must be enabled by your administrator.
Use the assistant
To use the assistant in Experience Builder, complete the following steps
- Verify that you are signed in to an organization.
You must sign in as a member of an organization with a role that includes privileges to use AI assistants.
- In Experience Builder, open an Arcade editor.
You can open Arcade editors from the following places:
- Click
Arcade assistant.The Arcade assistant pane appears.
- 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 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, then click Refine to submit the modified query.
- To provide feedback on the assistant, click the Helpful
or Unhelpful
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.
Understand best practices
The following are guidelines that will help you generate Arcade expressions using the Arcade assistant (beta):
- Be clear and concise in your requests.
- Avoid ambiguity and vague language.
- While using exact field names is not required, providing sufficient detail is recommended.
Tip:
The following are examples of a productive prompt and an unproductive prompt for generating an expression to
Understand context limitations
Keep the following limitations in mind while using the Arcade assistant (beta):
- The assistant is not a chatbot. It does not remember information you provided in previous prompts. When refining a previous prompt, be sure to include all relevant details as if you were asking the assistant for the first time.
Note:
The following are examples of a productive sequence of prompts and an unproductive sequence of prompts:
- Productive sequential prompts:
- "When no features are selected, return 'All Regions'. When features are selected, return the names of the selected features." The assistant generates a script that lists too many place names to fit in the Text widget if many features are selected.
- "When no features are selected, return 'All Regions'. When features are selected, return the names of the selected features. If there are more than three selected features, return the names of three selected features." The context of the original prompt is retained with the additional detail of asking to limit the number of names to three, making this a productive sequence of prompts.
- Unproductive sequential prompts:
- "When no features are selected, return 'All Regions'. When features are selected, return the names of the selected features."
- "Only return up to three names." The context of the original prompt is lost, making this an unproductive series of prompts.
- Productive sequential prompts:
- The assistant is not aware of any previously generated Arcade expressions or of existing expressions in the Arcade editor.
Tip:
The following are examples of a productive prompt and 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:
The following are examples of a productive prompt and an unproductive prompt:
- Productive prompt: "If the population density is above 500, return 'high density'. If it is between 100-500, return 'moderate density'. If It is below 100, return 'low density'. This prompt is productive because the values are specific and the categories are defined.
- Unproductive prompt: "Break up the population density field into multiple categories using natural breaks: 'high density','moderate density', and low density'." 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. The only context the assistant has is field names and aliases for the layers associated with the expression. Additionally, the assistant is unaware of attachments and related tables that may be associated with the layers. For this reason, there is limited support for generating expressions using FeatureSet functions. If you want to add data or 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 you do not provide this information, 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:
The following are examples of a productive prompt and an unproductive prompt:
- Return the number of incidents that occurred within the boundary of Washington state. Use the NAME field in the us_states_2000 layer to perform this calculation." This prompt is productive because it defines the specific geographic boundary and the layer in the map that should be used when generating the expression.
- Unproductive prompt: "Return the number of incidents that occurred in Washington." This prompt is unproductive because it is unclear whether Washington state, Washington, D.C. or another similarly named location is desired. Additionally, it is unclear which layer in the map should be used to perform the query.