Configure a layer you do not own
Your team has provided some items to create the map. First, you'll open a map, add a layer to it, and review each layer's attribute table. Then, you'll create the pop-ups for the trailheads layer, a layer that you do not own, using ArcGIS Arcade.
Open a map and add a layer
You'll start by opening and saving a copy of a map that includes a trailheads layer. Then, you'll add a trails layer.
- Open Santa Monica Trails - Start Map.

- Click Sign In and sign in with your ArcGIS organizational account.
Note:
If you don't have an organizational account, see options for software access.
You'll save a copy of the map to your account.
- On the Contents (dark) toolbar, click Save and open and choose Save as.

The Save map window appears.
- For Title, delete - Start Map.
- Click Save.
The map is saved to your account.
- On the Contents (dark) toolbar, click Layers.
The Layers pane appears. The map has one layer, the trailheads layer, titled Trailheads/Inicios de senderos. You'll use a geodatabase provided by your team to create the trails layer.
- Download Santa_Monica_Trails.zip.
- In the Layers pane, next to Add, click the drop-down arrow. Click Add layer from file.

- In the Add layer window, click Your device. Browse to and select the file you downloaded.
- For File type, choose File geodatabase. Click Next.
- For Title, type SantaMonicaTrails followed by your name or initials.
Note:
You cannot create two layers in an ArcGIS organization with the same name. Adding your initials to a layer name ensures that other people in your organization can also complete this tutorial. Once a layer has been created, you can rename it in the map to remove your initials, which will not affect the name of the underlying data layer.
- Click Create and add to map.
The layer is created and added to the Layers pane and the map. You want the layer name to match the format of the trailheads layer, Trailheads/Inicios de senderos, so you'll rename it.
- In the Layers pane, for SantaMonicaTrails, click the Options button and choose Rename.

- For Title, delete the existing text and type Trails/Sendero. Click OK.
- In the Layers pane, drag the trails layer below the trailheads layer.
- Click Save and open and choose Save.
The changes to the map are saved.
Explore the data
Your map now has two layers. You'll look at their properties and attribute tables in preparation for configuring pop-ups. First, you'll review the trailheads layer.
- In the Layers pane, click the trailheads layer to select it.
The Properties pane appears. You'll find out who owns the layer's data source.
- In the Properties pane, expand Information. Under Source layer, click SAMO Public Trailheads and Access Points (public view).

The item page for the source layer opens in a new browser tab. This item page includes the URL of the service and other details. It also indicates the layer is owned by Esri_Tutorials.

Since you do not own the layer, you can't make changes to it. That's important because it means you cannot edit data in the attribute table or add new fields. You'll need to find another way to create and display the required data in the pop-ups. Next, you'll look at the values in the attribute to see the data available about trailheads.
- On the ribbon, click the Data tab.
The attribute table opens. There are 261 trailheads (rows) with several dozen attributes (columns/fields) for each one. The first field is titled TH_Name, short for trailhead name.
- Review the values for TH_Name.
The values include full trailhead names, which will be useful for the pop-ups.
- Review the values for the fields Parking and Dogs.
You want the pop-up for the trailheads to include the trailhead name and a list of available amenities. The values for the Parking field are Yes and No. The values for the Dogs field are Y and N. To create the list of amenities, you'll need to turn Yes and No and Y and N into meaningful terms like Parking and Dogs allowed.
Next, you'll look at the trails layer.
- Return to the browser tab with your map.
- In the Layers pane, click the trails layer.
The Properties pane for the trails layer appears.
- In the Properties pane, expand Information and click SantaMonicaTrails.
The item page for the source layer opens in a new tab.
You are listed as the owner of this layer, which gives you more privileges to work with it. Specifically, you'll be able to edit the layer, giving you more flexibility and options to configure the pop-ups for the trails layer. Next, you'll look at the values in the attribute table.
- On the ribbon, click the Data tab.
The attribute table opens. There are more than 2,200 trails with about a dozen attributes for each one.
- Scroll through the table's fields.
You want the pop-up for the trails to include the trail name and a sentence describing its length, type, and who can use it.
The table includes a few pairs of fields, one in English and one in Spanish, which store information about each trail. You are interested in Use and Use_es because their values indicate who can use the trail. The English values include Multi-use, Hiker Only, Undesignated, and Hiker-equestrian. The Type field has values of a single letter: T, R, P, V, C, and N. Your colleagues have shared that these are codes for trail, unpaved road, paved park road, paved public road, trail planned for closure, and N/A, respectively. Importantly, the Type field does not have a Spanish counterpart.
You'll need to make some changes to the attribute table before you configure the trail layer pop-ups. You'll add a field for the Spanish values for Type and turn the one-letter codes into meaningful phrases in both English and Spanish.
Create an Arcade expression
First, you'll configure the trailhead pop-ups. These pop-ups will include a trailhead's name and a list of amenities available there. You'll remove unneeded content from the default pop-ups and then write an expression in Arcade, a scripting language.
- Return to the tab with your map.
- Click the trailheads layer to select it.
- On the Settings (light) toolbar, click Pop-ups.

The Pop-ups pane and a sample pop-up appear. The pop-up title is long, so you'll change it to show only the trailhead name.
- In the Pop-ups pane,
click Title.

The current title is made up of the layer name followed by a colon and the value in the {TH_Name} field.
- Replace the title text with {TH_Name}.

The sample pop-up title updates to the trail name. Under the title is a table of attributes. Since you'll be providing a list of relevant attributes, you'll remove all field names and values from the pop-up.
- For Fields list, click the Options button and choose Delete.

In the sample pop-up, the field names and values disappear. Next, you'll write an Arcade expression that returns the English or Spanish title for the list.
- In the Pop-ups pane, click Attribute expressions.

- Under Attribute expressions, click Add expression.
An editing window appears. This window is where you'll write your Arcade expressions. To provide the proper title for your list, you'll first have to determine which language to use. Then, you'll return either the English title Amenities or the Spanish title Comodidades. You'll write the code to determine the current language preference using an environment variable.
- In row 1, copy and paste the following code:
var env = GetEnvironment(); var locale = env['locale'];These lines find the current value of a specific environment variable, called locale, which stores the current language preference in ArcGIS Online.
Note:
To learn more about Arcade syntax, try the tutorial Get started with ArcGIS Arcade.
- Place your cursor at the end of row 2 and press Enter twice.
You have added a blank line. The cursor is now on line 4. Adding blank lines helps make finding sections of the code easier. You'll add the next block of code.
- In row 4, copy and paste the following code:
IIf((locale != 'es'), 'Amenities: ', 'Comodidades: ');This line indicates that if the variable locale is not set to es, the locale value for Spanish, the code should return the list title text: Amenities: . That's the word Amenities, followed by a colon (:) and a space. If the variable is set to es, the code should return Comodidades: . The colon (:) and space are important, since this text will precede the list of amenities in the pop-up. Next, you'll test your Arcade expression.
- Click Run.
The Arcade expression runs using data for the first item in the attribute table. It returns Amenities: in the Output pane. If the code does not run, confirm that you copy and pasted the code properly.
- When your expression runs successfully, at the top of the editor, replace New expression with Translate amenities.
- Click Done.
Your Arcade expression is saved in the map. It's a good idea to save the map each time you complete an expression.
- Save the map.
Create a second Arcade expression
You set the pop-up's title to the trail name and wrote an expression for the list title text. Next, you'll use Arcade to build the list that matches the current language preference.
- If necessary, return to the Expressions section of the Pop-ups pane. Click Add expression.
This second expression will start like the first, determining the user's language preference by determining the locale environment variable.
- In row 1, copy and paste the following code:
var env = GetEnvironment(); var locale = env['locale']; - Place your cursor at the end of row 2 and press Enter twice.
- In row 4, copy and paste the following code:
var field1 = $feature.Parking; var field2 = $feature.Restroom; var field3 = $feature.Dogs; var field4 = $feature.Garbage; var field5 = $feature["Mutt_Mitt"]; var field6 = $feature["Info_Kiosk"] var field7 = $feature["Ranger_Station"] var field8 = $feature.Recycling var field9 = $feature["Scenic_Ovrlk"] var field10 = $feature.Water var field11 = $feature.Wayside var field12 = $feature["Camp_Reg"] var field13 = $feature.Phone var field14 = $feature.Picnic var val1 = Decode(field1, 'Yes', 'Parking', ''); var val2 = Decode(field2, 'Yes', 'Restroom', ''); var val3 = Decode(field3, 'Y', 'Dogs Allowed', ''); var val4 = Decode(field4, 'Yes', 'Garbage Cans', ''); var val5 = Decode(field5, 'Yes', 'Mutt Mitt Dispenser', ''); var val6 = Decode(field6, 'Yes', 'Info Kiosk', ''); var val7 = Decode(field7, 'Yes', 'Ranger Station', ''); var val8 = Decode(field8, 'Yes', 'Recycle Bins', ''); var val9 = Decode(field9, 'Yes', 'Scenic Overlook', ''); var val10 = Decode(field10, 'Yes', 'Potable Water', ''); var val11 = Decode(field11, 'Yes', 'Wayside Exhibit', ''); var val12 = Decode(field12, 'Yes', 'Campground', ''); var val13 = Decode(field13, 'Yes', 'Pay Phone', ''); var val14 = Decode(field14, 'Yes', 'Picnic Tables', '');This code has two parts. The first part defines 14 variables, field1 through field14. Each variable represents one of the possible amenities found at a trailhead. Fields that have one-word names, like Parking, are defined with different syntax than those that have underscores, like Info_Kiosk.
The second part of the code assigns a value to each variable. That text value will appear in the pop-up. All the amenity values in the attribute table are Yes or No (or Y and N). Your goal is to list all the amenities in each trailhead, so you want to replace Yes (or Y) text with the name of the amenity. No (or N) means the amenity is not available at that trailhead, so no text needs to be added to the list.
For example, in val1, if the value for the Parking field is Yes, then val1 is assigned Parking, the text to be added to the list. If the value is not Yes, the variable is set to null (no value). For val3, if the value for the Dogs field is Y, then val3 is assigned Dogs Allowed.
- Place your cursor at the end of line 31 and press Enter twice.
- In row 33, copy and paste the following code:
var val1_es = Decode(field1, 'Yes', 'Aparcamiento', ''); var val2_es = Decode(field2, 'Yes', 'Bano', ''); var val3_es = Decode(field3, 'Y', 'Se admiten perros', ''); var val4_es = Decode(field4, 'Yes', 'Basureros', ''); var val5_es = Decode(field5, 'Yes', 'Dispensador de guantes para perros', ''); var val6_es = Decode(field6, 'Yes', 'Quiosco de información', ''); var val7_es = Decode(field7, 'Yes', 'Estación de guardabosques', ''); var val8_es = Decode(field8, 'Yes', 'Papeleras de reciclaje', ''); var val9_es = Decode(field9, 'Yes', 'Mirador panorámico', ''); var val10_es = Decode(field10, 'Yes', 'Agua Potable', ''); var val11_es = Decode(field11, 'Yes', 'Exposición al borde del camino', ''); var val12_es = Decode(field12, 'Yes', 'Campamento', ''); var val13_es = Decode(field13, 'Yes', 'Teléfono público/Pagar Phon', ''); var val14_es = Decode(field14, 'Yes', 'Mesas de picnic', '');This code assigns values for variables numbered val1_es through val14_es. The es stands for Spanish. These variables store the amenity names in Spanish. The same values (Yes and Y) defined in the first part of the code block (field1 through field14) are referenced again. For example, the values val1_es would be assigned the text Aparcamiento (parking) and val3_es would be set to Se admiten perros (dogs allowed) for Yes and Y values in the attribute table.
- Place your cursor at the end of line 46 and press Enter twice.
- In row 48, copy and paste the following code:
var lst_en = [val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12, val13, val14]; var lst_es = [val1_es, val2_es, val3_es, val4_es, val5_es, val6_es, val7_es, val8_es, val9_es, val10_es, val11_es, val12_es, val13_es, val14_es]; var lst = IIf((locale != 'es'), lst_en, lst_es);This code creates two lists. The first, lst_en, collects all values (text and null) of the amenities available for a trailhead in English. The second, lst_es, collects all the values of the amenities available in Spanish.
The final line uses the locale variable set at the beginning of the expression. It indicates that if the locale variable is not es, then the English list will be used. Otherwise, the Spanish list will be used.
- Place your cursor at the end of line 50 and press Enter twice.
- In row 52, copy and paste the following code:
var result = ""; for (var i in lst) { If (!IsEmpty(lst[i])) { if (result == "") { result = lst[i]; } else { result += ', ' + lst[i]; } } } return result;This code defines a loop that moves through each field and creates a text string with each amenity name, followed by a comma. If the loop finds a null value, it skips it. When there are no more amenity names, it returns the list. You'll test your Arcade expression.
- Click Run.
The Arcade expression runs using data for the first item in the attribute table. It returns Parking, Restroom, Garbage Cans, Info Kiosk, Potable Water, Pay Phone in the Output pane. If the code does not run, confirm that you copy and pasted the code properly.
- When your expression runs successfully, name the expression Translate list of amenities.
- Click Done.
- Save the map.
Combine the expressions
You now have the two expressions needed to create the text in the trailhead pop-up. Next, you'll combine them to create the list of amenities and display it in the pop-up.
- In the Attribute expressions pane, click the Back button.

The sample pop-up currently has just the trailhead name. You'll add text to display the results of the two attribute expressions.
- Under Title, click Add content and choose Text.

An editor appears. You'll put the second expression, Translate amenities, first because it returns the list title. Then, you'll add the first expression, Translate list of amenities, which returns the list.
- In the editor, click Fields List and choose Translate amenities.

The expression is added to the editor.
- Place the cursor after the closed bracket, }. Click Fields List and choose Translate list of amenities.

The two expressions are in the editor. You'll make the list title more visible by making it bold.
- Highlight the first expression and click the Bold button.

- Click OK.
The sample pop-up displays Amenities: in bold, followed by a space and the list of available amenities.

- Save the map.
The pop-ups for the trailheads layer are complete. Each pop-up displays the trailhead name and the list of amenities available. Next, you'll configure the trails layer pop-ups.
Configure a layer you do own
You've configured the pop-ups for the trailheads layer, a layer you do not own, using Arcade. Next, you'll configure the pop-ups for the trail layer, a layer you do own. First, you'll make changes to the attribute table to address some missing data. Then, you'll create the pop-ups for the layer using Arcade.
Add a field to the trails layer
You identified a field in the trail layer attribute table, Type, that does not have a Spanish counterpart. You'll add a field to store the values for Spanish terms, then you'll populate it.
- Open the browser tab for the trails layer item page.
- Click the Data tab.
A table view of the attribute table appears. You'll create the new Type_es field for the Spanish values to match the properties of the existing Type field that stores the one-letter codes.
- At the top of the table, click Add field.

You'll create a field with the same properties as Type: a text field that stores a string with a length of one character.
- For Select the data type that will be stored in the field, click Text and choose String.

- Click Next.
- For Field name, type Type_es. For Length, type 1.
- Click Add field.
The new empty field is added to the far right of the table. Next, you'll populate the Type_es field with the same values as stored in the Type field.
- Scroll to the right of the table. For Type_es, click the Options button and choose Calculate.

The Calculate field tab opens with tools and a preview of the attribute table and the layer.
- For Select language, choose Arcade.

Note:
In this case, language refers to the language of the code you'll use to calculate a value into the new field, not the language of the text.
- Click Next.
The Define filter (optional) pane appears. A filter can be used to limit which features the calculation is run on. Since you want to calculate values for all the trail features, you won't use a filter.
- Click Next.
The Arcade expression editor appears. You'll write an Arcade expression to populate the new Type_es field with the values currently in the Type field.
- Click Profile variables. For $feature, click the arrow.

A list of attribute table fields appears. You'll choose the Type field, since it's the source of the values for the new field
- In the list, click $feature.Type.

The profile variable $feature.Type is added to the editor in line 1. The expression will copy the values from the Type field to the Type_es field. Next, you'll preview the results. Calculation results are saved immediately, so this is a good practice.
- Above the table, click Preview values.

The table updates to show a preview of some of the calculated values.

The calculated values look correct. Next, you'll run the expression for all the features in the layer.
- Click Run calculation.
After a moment, the values from the Type field are copied to the Type_es field.
- On the vertical toolbar, click Table. Scroll to the right to see the values for the Type_es field.

Associate letter codes with labels
Next, you'll use a domain list to associate the one-letter codes in the Type and Type_es fields with English and Spanish terms.
A domain list allows you to associate a code—the value stored in ArcGIS Online and a label—the text presented to users in lists and attribute tables. The Type and Type_es fields already have codes (T, R, P, V, C, and N). You'll associate each code with a label. First, you'll assign the English labels for the Type field.
- In the table, scroll to the Type field. Click the Options button and choose Quick view.

- Click View details.
A window with details about the field appears.

There are 1,310 features with the T code and only one with the N code. Next, you'll assign a label for each code.
- Under Domain, click Get started.
The Manage domain window presents three options:
- Enter values—You type both codes and labels.
- Find values—You are provided with codes; you type in labels.
- Import values—You provide a file with codes and labels.
You'll choose Find values, the option that provides the codes in the attribute table, to save some typing.
- Choose Find values.

- Click Next.
A table appears. You'll update the labels to English terms and phrases.
- For each code, type its label:
- For T, type trail.
- For R, type unpaved road.
- For P, type paved park road.
- For V, type paved public road.
- For C, type trail planned for closure.
- For N, type N/A.

- Click Save.
The domain list is updated. The codes and labels are now associated. You'll review the updated values in the table.
- On the vertical toolbar, click Table. Scroll to the Type field.

The Type field now shows the labels rather than the codes. Next, you'll set up a domain list for the Type_es field using the Import values option. You'll download a CSV file with the codes and labels.
- Download the type_es CSV file.
- Scroll to the Type_es field.
- For Type_es, click the Options button. Choose Quick view and click View details.
- Click Get started. Choose Import values.
- Browse to and select the type_es CSV file you downloaded.
The labels and codes are populated.
- Click Save.
The domain list updates and the Type_es codes are replaced with Spanish labels.
- On the vertical toolbar, click Table and scroll to the Type_es field.

The Type and Type_es fields now display English and Spanish terms, rather than single-letter codes.
Configure trail pop-ups
You've updated the trail layer's attribute table to include English and Spanish terms for type. Next, you'll configure the trail layer pop-ups.
- Return to the browser tab with your map.
Since you made changes to the trails layer's source data, you'll need to refresh the map to access the latest version of the data.
- If necessary, save the map. Refresh the browser tab.
The map redraws, updating data from the layer sources.
- In the Layers pane, confirm the Trails/Sendero layer is selected.
- On the Settings toolbar, click Pop-ups.
A sample pop-up appears.
The pop-up maintains the same configuration for showing attributes as it did before you added the Type_es field, meaning the sample pop-up does not display the Type_es field. You would have to update the pop-up's fields list to display it.
Next, you'll set the title and remove the fields from the pop-up.
- Click Title. Delete all the text except {Name1}.
- For Fields list, click Options and choose Delete.
The sample pop-up shows only the trail name. Next, you'll compose a sentence using Arcade, which describes the trail indicating how long it is, who can use it, and its type.
- Click Attribute expressions and click Add expression.
The expression editor opens.
- In line 1, copy and paste the following code:
var env = GetEnvironment(); var locale = env['locale'];This code defines a variable with the current locale environment variable.
- With the cursor at the end of line 2, press Enter twice. On line 4, copy and paste the following code:
if (Left(Lower(locale),2)!= 'es'){ return $feature.Name1 + ' is a ' + Text($feature.Miles, '#,###.00') + ' mile long ' + Lower(DomainName($feature, 'Use_')) + ' ' + Lower(DomainName($feature, 'Type')) + '.' } else if (Left(Lower(locale),2) == 'es') return $feature.Name1 + ' es un ' + Text($feature.Miles, '#,###.00') + ' milla de largo ' + Lower(DomainName($feature, 'Use_es')) + ' ' + Lower(DomainName($feature, 'Type_es')) + '.'This code creates an English sentence if the locale is not set to es and a Spanish one otherwise. Using DomainName indicates the label assigned in the domain list should be used, rather than the code.
- Test the expression.
- When your expression runs successfully, name the expression Locale dependent pop-up domain value.
- Click Done.
- Save the map.
Next, you'll add text to display the sentence in the pop-up.
- Click the Back button. Click Add content and choose Text.
The text editor opens. You'll use the expression you wrote to populate the text.
- Click Fields List and choose Locale dependent pop-up domain value.
- Click OK.
The preview pop-up now includes the text content created by the expression.

- Save the map.
Test the pop-ups
With the layers' pop-ups configured, you'll test whether the pop-ups display correctly depending on the user's language preference. First, you'll view the pop-ups in English. Then, you'll change your locale variable by updating your map's URL to view the pop-ups in Spanish.
- On the map, zoom in to Point Dume Natural Preserve at the southern tip of the Santa Monica Mountains National Recreation Area.

- Click the trailheads and trails to see the pop-ups in the current language setting.
Next, you'll temporarily change the locale environment variable to es for Spanish.
- In the search bar of the browser tab, at the end of the map's URL, add the text &locale=es.

The URL will have this form:
https://[your-organization].maps.arcgis.com/apps/mapviewer/index.html?webmap=8727x279574x49x592x657x7xxx7x4xx&locale=es
- Press Enter to refresh the browser tab.
The map updates.
Note:
To return the URL to the previous locale value, delete &locale=es and refresh the browser tab.
- Return to Point Dume Natural Preserve on the map.
- Click the trailheads and trails to see their pop-ups.

The text in the trailhead pop-ups displays in Spanish.
The text in the pop-ups is called map and label text. It's sourced from the map layers. Other text in the Map Viewer interface changed language, including the names of the tools in the pop-ups, toolbars, panes, and windows. This text is Esri text, text that's part of ArcGIS Online.
A third kind of text is app-authored text, which includes the name of the map. This text has not been configured to be available in Spanish, so it remains in the language set by your saved locale value.

- In the browser tab, in the search bar, at the end of the map's URL, delete &locale=es. Refresh the browser tab.
The map returns to the language of your saved locale environment value.
In this tutorial, you configured map and data text for use in a bilingual app. You used Arcade to create pop-ups in English and Spanish for a layer you did not own. Then, you edited the table of a layer you did own to create meaningful pop-ups in the two languages. Lastly, you tested the language functionality by temporarily changing your locale environment variable.
Your map is configured to provide information about trailheads and trails in English or Spanish, depending on the user's preference. Presenting the map in an app will make the user experience richer. The tutorial Configure apps for hikers details how to configure a multilingual app based on a map similar to the one you configured in this tutorial.
You can find more tutorials in the tutorial gallery.