Skip to main content

Apply Arcade expressions

ArcGIS Arcade is an expression language used in ArcGIS Pro to customize map elements and manage data, including calculating values and implementing attribute rules. It is unique among expression languages in that it includes feature and geometry data types. Arcade can be used across the ArcGIS platform, although different products support different profiles. Profiles define the environment and rules for how an Arcade expression is evaluated and interpreted.

Overview

  • This video was created with ArcGIS Pro 3.8.

In this tutorial, you'll explore how existing Arcade expressions customize the labeling and symbology in a map in ArcGIS Pro. You'll implement additional expressions for labels, symbology, pop-ups, field calculations, and, optionally, attribute rules. Finally, you'll view the map in ArcGIS Online Map Viewer to see the portability of Arcade expressions.

  • Estimated time: 60 minutes (75 minutes with optional section)

  • Software requirements:

    • ArcGIS Pro Basic

    • ArcGIS Pro Standard is required for the optional attribute rules section

Note:

The quick-start tutorials are updated at each software release. For the best experience, use an online help version that matches your software version.

Open the project

In this project, you'll use Arcade to enhance a map of electric vehicle (EV) charging stations and highways in the United States and manage the data in the supporting layers.

  1. Start ArcGIS Pro and sign in if necessary.

  2. Open a browse dialog box to search for the project in one of the following ways:

    • On the start page, click Open another project .

    • In an open project, click the Project tab on the ribbon. In the list of side tabs, click Open. On the Open page, click Open another project .

      Open another project command

  3. On the Open Project browse dialog box, in the navigation pane, under Portal , click ArcGIS Online .

    Note:

    If you are signed in to ArcGIS Enterprise , you must set your active portal to ArcGIS Online to access the tutorial data. If you can't do this, you can download the data from a browser.

  4. At the top of the dialog box, in the Search box, type Apply Arcade expressions and press the Enter key.

  5. In the list of search results, click Apply Arcade expressions to select the project package.

    Note:

    If there is more than one project package with this name, select the package with the Authoritative badge . In the Owner column, the owner name is ArcGISProTutorials. If you don't get any results, see No search results are returned.

  6. Click OK.

    The project opens with a map view of the contiguous United States with highways symbolized.

    Default map view showing the contiguous 48 states of the U.S.

  7. On the ribbon, click the View tab. In the Windows group, click Pane Sets and click Mapping .

    This ensures that the Contents and Catalog panes are open and that other panes are closed.

  8. On the ribbon, click the Map tab. In the Navigate group, click Bookmarks and click Ontario, California.

    The map view zooms in to Ontario, California, a city about 40 miles east of Los Angeles. The charging stations, which were not visible at the full extent, are symbolized on the map. The EV Charging Stations layer visibility is set to a minimum scale of 1:5,000,000, meaning it only draws when the map is zoomed to a scale of 1:5,000,000 or larger (more zoomed in).

    Map view of Ontario, California displaying highways and charging stations

Explore Arcade expressions

Arcade allows you to customize your map's appearance. You'll find the EV Charging Station layer's existing Arcade expressions and see how they control the labels and symbology.

  1. In the Contents pane, right-click the EV Charging Stations layer and click Attribute Table .

    The attribute table opens. Each EV charging station is represented as a row and each attribute is represented as a column, or field. Attributes include station name, address, and access days and times.

    The EV Network field stores the name of the charging network that operates each station. EV Network is the field alias shown in the attribute table. You'll view an expression that uses the underlying field name, EV_Network.

  2. Confirm that the EV Charging Stations layer is selected in the Contents pane. On the ribbon, click the Labeling tab. In the Layer group, click Label .

    The labels for the EV charging station points appear on the map, displaying the EV charging network powering each station. You'll look at the Arcade expression for the label class to see how it changes the appearance of the text.

    EV charging stations with labels activated

  3. In the Label Class group, click Expression .

    The Label Class pane appears with an Arcade expression in the Expression box. The label expression is titled Charging Network.

    The label class pane with a preset Arcade expression

    For features in the EV Charging Stations layer, the expression returns the name in the EV_Network field with the word Network removed. As a result, names such as ChargePoint Network and eVgo Network appear in the labels as ChargePoint and eVgo.

    Dive in:

    Replace is an Arcade function that replaces one text string with another. A function defines a block of statements, or instructions, to run when called.

    The argument $feature.EV_Network uses the $feature profile variable to reference the current feature and the dot operator to specify the EV_Network attribute. Profile variables are the input data values to an Arcade expression within a given profile.

    The text to be replaced and the replacement text are also arguments, each enclosed in quotation marks. The replacement text is an empty string, which effectively removes the word Network and replaces it with nothing.

    Next, you'll explore how Arcade is applied to create the symbol classes.

  4. Ensure the attribute table for the EV Charging Stations layer is open. Scroll across the table until you see the DC Fast Ports field.

    The counts of Level 1, Level 2, and DC fast chargers are stored in the Level 1 Ports, Level 2 Ports, and DC Fast Ports fields, respectively. These fields are used to create the symbol classes in the EV Charging Stations layer.

    The fields in the EV Charging Stations layer that identify charger counts by type

  5. Close the attribute table.

    On the map, a mix of green, orange, and purple points represent the charging stations around Ontario. In the Contents pane, below the EV Charging Stations layer name, the heading Highest Charging Level Available and the symbol classes are displayed. Green represents stations with DC fast charging, orange represents stations with up to Level 2 charging, and purple represents stations with only Level 1 charging.

    Contents pane showing the EV Charging Stations layer symbology

  6. In the Contents pane, right-click the EV Charging Stations layer and click Symbology .

    The Symbology pane appears.

  7. In the Symbology pane, next to Field 1, click Set an expression .

    The Arcade Editor dialog box appears with an Arcade expression in the expression box.

    Arcade editor with a pre-configured Arcade expression for symbology

    The expression assigns symbol classes and labels based on the highest charging level available at each station.

    Dive in:

    var creates three variables named Fast, Level2, and Level1. These variables store the number of DC fast, Level 2, and Level 1 chargers available at each station. The expression uses the $feature profile variable to access the corresponding attribute values.

    The return statement uses a When function to create three symbology classes. It evaluates the Fast, Level2, and Level1 variables in order. The first variable with a value greater than 0 determines the station's highest charging level available and assigned label. For example, if Fast and Level2 are 0 and 1, respectively, the station will be classified as Level 2. If all three variables are 0, null is returned.

    In the Classes tab on the Symbology pane, in the More drop-down menu, Include all other values is not checked, so null values are not symbolized. A value of null is returned for only 14 of the 18,168 stations in the feature class, which accounts for less than 0.02% of stations.

  8. Click Cancel to close the Arcade Editor dialog box.

Customize the labels

Although it's helpful to know the highest charging level available at a station, some cars do not support fast charging. The drivers of these cars will want to know if a DC fast-charging station also has Level 2 charging available. You'll modify the label expression to include all the charging levels available at a station.

  1. Confirm that the EV Charging Stations layer is selected in the Contents pane.

  2. Make the Label Class pane active. (If the pane is closed, right-click the EV Charging Stations layer and click Labeling Properties .)

  3. Click in the Title input box after the word Network and press the spacebar.

  4. Type and Levels Available.

  5. In the Expression box, delete the existing Replace expression.

  6. Copy the following Arcade block:

    var levels = [];
    
    if ($feature.Level1_Ports > 0) {
       Push(levels, "L1")
    };
    
    if ($feature.Level2_Ports > 0) {
       Push(levels, "L2")
    };
    
    if ($feature.DCFast_Ports > 0) {
       Push(levels, "DC Fast")
    };
    
    return Replace($feature.EV_Network, " Network", "")
       + " ("
       + Concatenate(levels, ",")
       + ")";
    
  7. In the Expression box, press Ctrl+V or right-click and click Paste to add the block to the label expression.

    Expression box with the pasted label expression

    The expression returns the network name and, in parentheses, a list of the charging levels available.

    Dive in:

    Push is an array function. An array is an object representing a list of elements. The expression initializes the variable levels as an empty array. The if statements add charging level abbreviations to levels via the Push function. For example, if a station has at least one Level 2 charging port, Push adds L2 to levels. The return statement uses the Concatenate function to combine the network name with a comma-separated list of the charging levels in parentheses.

  8. Under the Expression box, click Verify .

    The expression is marked as valid.

    Tip:

    If you get an error message after clicking Verify, check to ensure that the entire expression was pasted.

  9. Click Apply.

    The labels update, showing each station's available charging levels. One of the green points is labeled eVgo (L2, DC Fast), meaning it has both Level 2 and DC fast charging capabilities.

    EV Charging Station labels showing the charging network name and levels available

  10. On the Quick Access Toolbar, click Save Project .

    Learn more about the labeling profile

Customize symbology

Although public EV charging stations are becoming more prevalent, road trips can still be a challenge for EV drivers. Most hope to find fast-charging stations along their routes, so they can recharge in 30 to 60 minutes (Level 2 chargers can take 12 or more hours to fully charge a vehicle). You'll symbolize each highway segment according to how far away its midpoint is from the nearest fast-charging station.

  1. On the ribbon, on the Map tab, click Bookmarks and click North Dakota.

    The map zooms to the north-central area of North Dakota, between Minot and Devils Lake. Since the label class for the stations is set to be visible at a minimum scale of 1:40,000, the labels no longer appear on the map.

    Minot and Devils Lake both have several fast-charging stations, with another along the road going south from Minot. Elsewhere on the map, only Level 2 stations are visible.

    A map view of north-central North Dakota, including the towns of Minot and Devils Lake

  2. In the Contents pane, right-click the Highways layer and click Attribute Table .

    The attribute table opens. The Station Distance (mi) attribute stores the distance from each highway segment's centroid to the nearest fast-charging station. You'll symbolize the segments using this attribute.

    The Highways attribute table with a field Station Distance (mi)

    Note:

    The Station Distance (mi) attribute was derived using the Make OD Cost Matrix Analysis Layer and Solve tools in the Network Analyst toolbox.

  3. Close the attribute table.

  4. Right-click the Highways layer and click Symbology .

    The Symbology pane becomes active.

  5. In the Symbology pane, on the Primary symbology tab , click the Primary symbology drop-down arrow and click Unique Values .

    Note:

    Although distance is a numeric value, you'll apply unique values symbology to the Highways layer. This method can classify features using text returned by an Arcade expression, allowing for meaningful category labels such as distance ranges. With graduated symbology, an expression must return a numeric value, so you would need to configure alphanumeric class labels separately.

  6. Next to Field 1, click Set an expression .

    The Arcade Editor dialog box appears.

    Arcade editor with the default expression for the Highways layer

  7. In the Title box, delete the default title and type Distance to Nearest Fast-Charging Station.

  8. In the expression box, delete the default expression.

  9. Copy the following expression.

    var d = $feature.StationDistance_mi;
    
    return When(
       d <= 10.0, "0-10 mi", 
       d <= 20.0, "10-20 mi", 
       d <= 30.0, "20-30 mi", 
       d <= 40.0, "30-40 mi", 
       "40+ mi"
    );
    
  10. In the expression box, paste the expression.

    The expression uses the StationDistance_mi attribute to divide the segments into five distance classes, with class breaks every 10 miles.

  11. Click Run .

    The Output tab appears with test output, confirming the expression is valid.

    Test output in the Arcade editor confirming the symbology expression is valid

  12. Click OK.

    The symbol classes are updated, but the reduced line width makes the highways harder to see. In addition, the default color scheme does not communicate progressive proximity to a fast-charging station.

    Map showing highways with updated symbology

    First, you'll change the line width to make the highways more visible.

  13. In the lower half of the Symbology pane, on the Classes tab, click the More drop-down arrow and click Format all symbols.

  14. At the top of the pane, click the Properties tab.

  15. Change the Line width setting to 3 pt. Click Apply.

    Highways symbolized with a line width of three points

  16. At the top of the pane, click Return to primary symbology page .

  17. On the Classes tab, click the More drop-down arrow and uncheck Include all other values.

    The symbol class for all other values is removed. It isn't needed because the Arcade expression assigns every feature to one of the defined distance ranges.

    You'll change the color scheme to one that better conceptualizes distance from a station.

  18. Click the Color scheme drop-down arrow and click More color schemes.

    The Choose a color scheme dialog box appears.

  19. In the search box, type yellow green 5 and press the Enter key.

  20. Scroll down, and under ColorBrewer Schemes (RGB), click the Yellow-Green (5 Classes) scheme and click OK.

    Choose a color scheme dialog box with selected color scheme

    The layer symbology updates, but it shows the closest segments in pale yellow and the furthest segments in dark green, which is counterintuitive. You'll reverse the symbol order.

  21. Click the More drop-down arrow and click Reverse symbol order.

    The segments closest to fast chargers are symbolized in green and the furthest segments are symbolized in yellow.

    Highways with the Yellow-Green color scheme reversed

  22. On the Quick Access Toolbar, click Save Project .

    Learn more about the visualization profile

Configure pop-ups

Pop-ups provide more information about features without cluttering the map view. You'll configure the pop-up for the EV Charging Stations layer to include the number of fast chargers a station has.

  1. On the ribbon, on the Map tab, in the Navigate group, click Bookmarks and click Denver, Colorado.

    The map zooms in to an interstate junction near downtown Denver.

    Map view of the Mousetrap interstate junction in downtown Denver

  2. Click one of the charging station points on the map.

    A pop-up containing information about the station appears. It shows the station name at the top, followed by the network name, address, and hours of operation.

    Pop-up for an EV charging station in Denver, Colorado

    Note:

    If you click on a point closely clustered with other points, your pop-up will identify the set of clustered stations at the top. You can click each station's name to reveal the information for that specific station.

    Pop-ups present attribute information in a user-friendly format. The default pop-up configuration shows the attribute table with field names in the left column and values in the right column. In this case, the pop-up has been customized to display attributes in paragraph text format.

  3. Close the pop-up.

  4. In the Contents pane, right-click the EV Charging Stations layer and click Configure Pop-ups .

    The Configure Pop-ups pane appears. The EV Charging Stations pop-up is titled with the Station_Name field and contains a text element. You'll enhance that element by incorporating an Arcade expression that identifies the count of fast chargers at the station.

    Configure pop-ups pane showing the existing text element

    Recall that the number of fast chargers is stored in the DC Fast Ports field of the attribute table.

  5. At the bottom of the Configure Pop-ups pane, click Expressions.

  6. On the Expressions page, click New.

    The Arcade Editor dialog box appears.

  7. In the Title box, change the title to Has Fast Charger.

  8. In the Name box, change the name to HasFastCharger.

    The name can't include spaces, but the title can, enabling a more readable display label in expression list.

  9. Copy the following expression.

    if ($feature.DCFast_Ports >= 1) {
      return $feature.DCFast_Ports + " fast charger(s)."
     }
    else {
      return "no fast chargers."
     }
    
  10. Paste the expression in the expression box.

    The expression returns custom text based on the value in the DCFast_Ports field. For example, if a station has 3 fast chargers, it returns the string 3 fast charger(s). If the station has 0 fast chargers, or the field value is null, it returns the string no fast chargers.

  11. Click Run .

    The Output tab appears with valid output, confirming the expression is valid.

  12. Click OK.

  13. At the top of the Configure Pop-ups pane, click Back .

  14. Double-click the text pop-up element in the pop-up definition list.

    Pop-up definition list with a pop-up text element

    This element contains a series of attribute references that form the existing pop-up text. You'll modify it to include a reference to the Arcade expression you created.

    Text element for the EV Charging Stations pop-up

    Note:

    If spell-checking is turned on (the default setting) unrecognized words are marked with wavy red underlines. You can turn spell-checking off in the proofing options.

  15. Click at the end of the last line, after {Access_Hours}, and press the Enter key twice.

  16. Type This station has and press the spacebar.

  17. Click the Field drop-down arrow and click the Has Fast Charger expression at the bottom of the list.

    An expression reference is added to the text element.

    Text element with a reference to the pop-up expression

  18. Click Back .

  19. On the map, click a green charging station to view its pop-up.

    Charging station pop-up identifying the selected station's number of fast chargers

    A sentence identifying the number of fast chargers at the station now appears below the original information.

  20. Click an orange charging station to see its pop-up.

    The pop-up text confirms what you already know from the layer symbology—that orange and purple stations don't have fast chargers.

  21. Close the pop-up.

Perform an advanced calculation

Arcade can be used to perform advanced calculations, such as those requiring data from multiple layers. You'll implement an expression comparing the number of households that own or lease an EV, an attribute of the Counties layer, to the county's total of fast chargers, a value derived from the EV Charging Stations layer. You'll display the result in the Counties pop-up.

  1. On the ribbon, on the Map tab, click Bookmarks and click Maine.

    Map view of Maine

    The map zooms to the state of Maine.

  2. In the Contents pane, turn off the Highways layer. Optionally, turn off the EV Charging Stations layer for a better view of the county boundaries.

  3. On the map, click any U.S. county. (If you click somewhere in Canada, you won't see a pop-up.)

    County pop-up with default view of attributes

    The county's pop-up appears with the default configuration. The EV Households attribute stores the number of households in the county with electric vehicles. The pop-up expression you'll apply performs a calculation with this value.

  4. Close the pop-up.

  5. Ensure the Configure Pop-ups pane is active.

  6. In the Contents pane, click the Counties layer.

    The pane displays the default configuration for the Counties layer pop-up.

    Configure Pop-ups pane showing default configuration for the Counties layer

  7. In the list of pop-up elements, hover over the Fields (13) element and click Remove pop-up element .

  8. At the bottom of the Configure Pop-ups pane, click Expressions.

  9. On the Expressions page, click New.

    The Arcade Editor dialog box appears.

  10. Change the expression title to Fast Chargers to EV Households.

  11. Change the expression name to FCtoEVHH.

  12. Copy the following code block.

    // Access the EV Charging Stations point layer
    var points = FeatureSetByName($map, "EV Charging Stations");
    
    // Get the geometry of each county
    var polygonGeom = Geometry($feature);
    
    // Get station points within each county's geometry
    var pointsWithin = Intersects(points, polygonGeom);
    
    // Sum the count of fast chargers in each county
    var totalFastChargers = Sum(pointsWithin, "DCFast_Ports");
    
    // Return text statement comparing counts of fast chargers and EV households
    if (totalFastChargers > 0) {
       return Concatenate(
          [$feature.NAME,
          ", ",
          $feature.STATE_ABBR,
          " has one fast charger for every ",
          ROUND($feature.EV_Households / totalFastChargers, 1),
          " households that own or lease an EV."])
    }
    
    // If no fast chargers exist, return only count of EV households
    else{
       return Concatenate(
          [$feature.NAME,
          ", ",
          $feature.STATE_ABBR,
          " has ",
          $feature.EV_Households,
          " households that own or lease an EV, and no fast chargers."])
    }
    
  13. Paste the block in the expression box.

    The expression is more complex than the previous ones. It uses the geometry of the Counties layer to sum the total number of fast chargers across all stations in each county. It then calculates the ratio of households that own or lease an EV to fast chargers and returns the result with custom text.

    Dive in:

    The $map profile variable enables access to other layers in the map, pulling the DCFast_Ports attribute (the number of fast chargers) from the EV Charging Stations layer. The Intersects statement finds all EV charging station points inside each county. The Sum statement adds the values in the DCFast_Ports field for all station points inside each county. Finally, the If and Else statements return different text depending on whether the county has any fast chargers.

    The calculation is performed on the fly, meaning it's not stored with the data but instead calculated each time a pop-up is opened.

    The lines that begin with // are comments. The Arcade compiler ignores comments, meaning they do not affect how the code is run. They help others understand complex expressions and can also be used to provide attribution or links to outside documentation.

  14. Click Run to confirm the expression is valid. Click OK.

The expression appears in the pane.

  1. In the Configure Pop-ups pane, click Back .

  2. In the list of pop-up elements at the top of the pane, click Text .

    A new text element appears in the pop-up definition list. You'll populate it with a reference to the expression you just created.

  3. Double-click the new text element and delete the default text.

  4. Click the Field drop-down arrow and click the Fast Chargers to EV Households expression.

    An expression reference appears in the text element.

  5. Click Back .

  6. On the map, click any county.

    The county pop-up appears. The title identifies the county by name. The body reflects the calculation and text from your expression.

    County pop-up with ratio of fast chargers to EV households

  7. Close the pop-up.

  8. On the Quick Access Toolbar, click Save Project .

    Learn more about the pop-up profile

Calculate a field

In addition to calculating values on the fly, Arcade can be used to calculate new fields in the attribute table. You'll use an Arcade expression to calculate the total number of chargers at each EV station.

  1. In the Contents pane, click the EV Charging Stations layer.

    If you turned the layer off in the previous section, you may want to turn it back on. It's not necessary, however, because in this section you'll work exclusively with the layer attribute table.

  2. On the ribbon, click the Data tab.

  3. In the Data Design group, click Fields .

    The fields view of the table opens. You use the fields view to work with field properties. In the fields view, each field in the EV Charging Stations table is a row, and each field property is a column. The Fields tab appears on the ribbon and is active.

  4. On the ribbon, on the Fields tab, in the Edits group, click New .

    A new field with a green row indicator appears at the bottom of the fields view. Its Field Name cell is editable.

  5. Change the field name to Total_Chargers and press the Tab key.

  6. In the Alias cell, change the alias to Total Chargers and press the Tab key.

  7. In the Data Type list, click Short.

    Fields view with added field for Total_Chargers

  8. On the ribbon, on the Fields tab, in the Manage Edits group, click Save .

  9. Close the fields view of the table.

  10. In the Contents pane, right-click the EV Charging Stations layer and click Attribute Table .

  11. Scroll to the end of the table to see the Total Chargers field.

    By default, all the values are <Null>.

  12. Click the column heading of the Total_Chargers field to select the field.

  13. In the attribute table toolbar, click Calculate .

    The Calculate Field toolbar opens.

  14. On the Calculate Field toolbar, click the Expression Type drop-down arrow and click Arcade.

    Expression Type list with Arcade selected

  15. Click Arcade Editor .

    The Arcade Editor dialog box appears.

  16. Copy the following expression.

    $feature.Level1_Ports + $feature.Level2_Ports + $feature.DCFast_Ports
    
  17. Paste the expression in the expression box.

    The expression adds the values in the three fields that store charger counts. Performing the calculation will write the sum to the new Total Chargers field.

  18. Click Run to confirm the expression is valid. Click OK.

  19. On the Calculate Field toolbar, click Calculate .

    When the process completes, the calculated values populate the Total Chargers field.

    Attribute table with calculated values for the Total Chargers field

  20. On the ribbon, click the Edit tab. In the Manage Edits group, click Save . Click Yes on the Save Edits prompt.

  21. Close the attribute table.

  22. On the Quick Access Toolbar, click Save Project .

    Learn more about the field calculation profile

Create an attribute rule (optional)

Users with Standard or Advanced licenses can create attribute rules that enforce data integrity. You'll use Arcade expressions to create a rule that calculates the number of chargers when a new record is added or updated in the EV Charging Stations table.

License:

If you have a Basic license, you won't be able to complete this section of the tutorial. Skip to the View Arcade expressions in ArcGIS Online section. To check your license type, click the Project tab on the ribbon. On the settings page, click the Licensing side tab.

  1. In the Contents pane, right-click the EV Charging Stations layer, point to Data Design, and click Attribute Rules .

    An attribute rules view opens. On the view, the Calculation tab is active.

    Attribute rules view with the Calculation tab active and no calculation rules defined

    Note:

    Users with a Basic license will see a message stating that Attribute Rules are read-only.

  2. Click Add Rule.

    An editable record for a new calculation rule is added and the New Rule pane appears in the view.

  3. In the New Rule pane, delete the default text in the Rule Name input box and type Calculate total chargers.

    The name of the pane changes to match the rule name.

  4. In the Description box, type Calculates the total number of chargers at a station when a record is added or updated.

  5. Click the Field drop-down arrow and click the Total_Chargers field.

  6. Click Expression .

    The Arcade Editor dialog box appears.

  7. Copy the following expression.

    Sum($feature.Level1_Ports,$feature.Level2_Ports,$feature.DCFast_Ports)
    
  8. Paste the expression in the expression box.

    This expression, which uses Arcade's Sum function, produces the same results as the expression applied in the Calculate a field section.

  9. Click Run to confirm the expression is valid. Click OK.

    The Arcade Editor dialog box closes and the expression appears in the Expression box of the Calculate Total Chargers pane.

  10. Under Triggers, check the Insert and Update check boxes.

    The calculation will run any time a record is inserted or updated.

  11. Under Triggering Fields, in the list of active fields, right-click any field and click Deactivate All.

    All the fields are moved to the Inactive list.

  12. In the empty list of active fields, click Add From Expression .

    The three fields used in the expression are added to the list of active fields. Updating a value in one of these fields—or adding (inserting) a record in the table—triggers the attribute rule to run.

    Triggering fields populated in the list of active fields

  13. On the ribbon, on the Attribute Rules tab, in the Manage Edits group, click Save .

    The calculation rule is saved. You'll add records to the table to observe the impact of the new rule.

  14. Close the Attribute Rules view.

  15. Right-click the EV Charging Stations layer and click Attribute Table .

    The attribute table opens.

  16. At the bottom of the table view, click Move to End to go to the end of the table.

  17. If necessary, scroll down, and click Click to add new row.

    A record is added to the table. You'll input test data to confirm that the calculation rule works.

  18. In the new record, click the Station Name cell. Type Attribute Test 1 and press the Enter key.

  19. Scroll across the table and double-click the new record's Level 1 Ports cell.

  20. Type any number in the cell and press the Tab key.

  21. Type numbers in the cells for the Level 2 Ports and DC Fast Ports fields, then press the Enter key.

  22. Scroll across the table to the Total_Chargers field.

    Although you haven't input anything into the new record's Total_Chargers cell, it contains the sum of the numbers you typed. The rule you created works as intended.

    New record showing the charging fields with test data

  23. On the ribbon, click the Edit tab. In the Manage Edits group, click Discard . Click Yes on the Discard Edits prompt.

  24. Close the attribute table.

  25. On the Quick Access Toolbar, click Save Project .

    Learn more about the attribute rules profiles

View Arcade expressions in ArcGIS Online

Arcade works across the ArcGIS system. However, the portability of expressions from ArcGIS Pro to other applications depends on the profiles enabled in each application. You'll explore an existing web map to see which of the expressions you created work in ArcGIS Online.

Tip:

To share your own map to the web, refer to the Share a web map help topic.

  1. Open the How far is the nearest EV charger? map in ArcGIS Online.

    A new tab displays the map in ArcGIS Online Map Viewer.

  2. On the Contents (dark) toolbar, click Bookmarks .

    The Bookmarks pane opens.

  3. Click Doral, Florida.

    The map zooms in to the Miami International Mall in Doral, Florida. The EV charging station labels are formatted just like the ones you generated in ArcGIS Pro.

    Map view of Miami International Mall in Doral, Florida

    You'll look at the Arcade expression for the label class to confirm this.

  4. On the Contents (dark) toolbar, click Layers .

  5. Click the EV Charging Stations layer if it is not already selected.

  6. On the Settings (light) toolbar, click Labels .

    The Label features pane appears.

  7. If necessary, expand the Class 1 label class section.

  8. Click Use expression .

    Use Expression button in the Label Feature pane in ArcGIS Online Map Viewer

    The Arcade expression editor appears with a label expression in the expression window. It matches the one you set earlier in the Customize the labels section of the tutorial.

    Map Viewer label expression matching the one set earlier in ArcGIS Pro

  9. Click Cancel to close the expression editor.

  10. On the map, click one of the EV charging station points.

    The pop-up for the feature appears. It includes the same information that you configured in ArcGIS Pro.

    EV charging station pop-up in web map

    You'll look at the Arcade expression in the pop-up configuration to confirm this.

  11. On the Settings (light) toolbar, click Pop-ups .

    The Pop-ups pane appears.

  12. Under Options, click Attribute expressions.

  13. In the list of attribute expressions, click Has Fast Charger.

    The expression editor opens. The expression window contains the same expression you set in the Configure pop-ups section.

    Map Viewer pop-up expression matching the one set earlier in ArcGIS Pro

  14. Click Cancel to close the expression editor.

  15. Close the pop-up.

  16. On the Settings (light) toolbar, click Pop-ups to close the Pop-ups pane.

  17. On the Contents (dark) toolbar, click Bookmarks and click North Dakota.

    On the map, the Highways layer symbology matches the symbology that you set in ArcGIS Pro.

    Map view of North Dakota with highways symbolized by distance from the nearest fast-charging station

    You'll look at the Arcade expression for the Highways layer symbology to confirm this.

  18. On the Settings (light) toolbar, click Styles .

    The Styles pane appears.

  19. On the Contents (dark) toolbar, click Layers .

    The Layers pane opens.

  20. Click the Highways layer.

    A legend for the Highways layer appears on the map.

  21. In the Styles pane, under Choose attributes, click the Distance to Nearest Fast-Charging Station expression.

    The expression editor opens. The expression window contains the same expression that you set to define the Highways layer symbology classes.

    Map Viewer symbology expression for distance to nearest fast-charging station

  22. Click Cancel to close the expression editor.

    You can't check the field calculation expression since it is only used at the time of calculation and not saved to the map. You also can't check the attribute rule expression because attribute rules cannot be used in ArcGIS Online.

    In this tutorial, you applied Arcade expressions to improve how map features are displayed and how data is managed in ArcGIS Pro. You also saw how expressions used for labels, symbology, and pop-ups can be shared across the ArcGIS platform, including Map Viewer.

    To learn more about ArcGIS Arcade, review the Developer Documentation. To get more practice with Arcade, complete the Try ArcGIS Arcade tutorial series.