Create hosted feature layer views

If you need a different view of the data represented by a single hosted feature layer—for example, you want to apply different editor settings, styles, or filters—create a hosted feature layer view of that hosted feature layer. If you want to provide users with a single view that joins the data for two hosted feature layers, create a joined hosted feature layer view.

When you create a feature layer view, a new layer item is added to Content. This new layer is a view of the data in the source layers, which means edits made to the data in the source appear in the view. However, because the view is a separate item, you can change properties and settings on the view item separately from the hosted feature layer item from which it is created. For example, you can allow members of your organization to edit the hosted feature layer but share a read-only feature layer view with the public.

Only the owner of a hosted feature layer or an organization administrator can create a hosted feature layer view. This is different than copying a layer, which can be done by nonowners and even public users.

Tip:

Creating a hosted feature layer view alters the schema of the source hosted feature layer. The Schema updated date that is present on the Overview and Data tabs of the hosted feature layer item page updates when the schema changes.

Because views reference existing data, they do not use additional credits.

Create a hosted feature layer view

Follow these steps to create a hosted feature layer view of one hosted feature layer or one of the sublayers in a hosted feature layer:

  1. Sign in to your organization.

    You must have privileges to create content, and you must be the owner of the hosted feature layer from which you want to create the view or be an organization administrator.

  2. Open Content > My content and open the item page for the hosted feature layer you want to use as a source for the view.

    The layer must be a hosted feature layer, not a feature layer added from the web or a feature collection.

  3. Click Create View Layer on the Overview tab of the layer's details page.
  4. Choose the layers to include in the hosted feature layer view.

    By default, all layers are included (checked). To exclude (uncheck) a layer from the view, click the layer name. Click the layer again to add it back to the view.

  5. Click Next to set a definition for each layer.
  6. Click the first layer to access the layer's definition options. Use the following options to define what features are included in each layer in the view:
    • Add filter—You can filter a view's contents by defining filter expressions for one or more of the fields in the layer.

      For example, you can exclude blank (null) field values or only include numeric field values greater than a number that you specify.

      To define a filter expression, click Add filter > Add expression and use the drop-down lists to construct the expression.

      You can add multiple filter expressions per layer. To do so, click Add expression and define an additional expression. Repeat this step for each filter expression you need to add.

      When you have all the filters defined, use the Filter results drop-down menu to define whether a feature must meet all the conditions defined in the filter expression to be included in the view (Match all expressions) or whether a feature must meet only one of the filter's expressions to be included in the view (Match at least one expression).

    • Area of interest—To limit the features included in the view, define a spatial extent for the layer. Only the features located in that extent will be included in the view.

      Click the Polygon or Rectangle button and draw an area on the map. To define the same area of interest for all the layers in the view, click Apply to all layers.

    • Fields—You can exclude fields from the view if the view users do not need to see them. For example, you can exclude fields that contain sensitive information (such as people's names, health information, or age).

      To define which fields to include in the view, click Select fields and click the field names to remove them from or add them to the view. To help you determine whether a field should be included or excluded from the view, click the info button next to the field name to see a description of the field. Click Done when you finish defining which fields to include in the view.

      Note:

      You cannot exclude fields that ArcGIS Online requires. For example, you cannot uncheck system fields such as the layer's ID. You also cannot exclude fields that don't allow null values if you have not set a default value for the field. If no default value is set, editors must have access to nonnullable fields to input values when editing.

  7. When you finish defining options for a layer, click the arrow next to Layer definitions to return to the list of all layers in the view.
  8. To set definitions for other layers in the view, repeat steps 6 and 7 for each layer.
  9. When you finish setting definition options for all layers in the view, click Next.
  10. Type a unique title for the hosted feature layer view.
  11. Choose the folder where the hosted feature layer view will be stored.
  12. If your organization has set up content categories, click Assign categories and select up to 20 categories to help people find the item.

    You can also start typing a category name to narrow the list of categories.

  13. Optionally, type tag terms separated by commas.

    Tags are words or short phrases that describe your item and help people find your item when searching. Federal land is considered one tag, while Federal,land is considered two tags.

  14. Type a summary that describes the use and content of the view.
  15. Click Create to create the view.

The hosted feature layer view's item page appears when the view is created.

Now you can share the view.

Create a joined hosted feature layer view

A joined hosted feature layer view allows you to combine data from two different sublayers in the same or different hosted feature layers or table layers based on a relationship between nonspatial attributes in each layer. You can join a layer to a layer, a layer to a table, or a table to a table.

Joined views are useful when you want to combine data from two layers and you need the data to dynamically update along with the source layers.

The following conditions must be met to create a joined hosted feature layer view:

  • There must be a column in each source layer that you can use to define a SQL join between the two layers. You can define a one-to-one join or a one-to-many join.
    Tip:

    Either determine what these columns are before you define the view, or you can preview the fields in each source layer while you're defining the view.

  • You must own both source hosted feature layers. Or, if you are an organization administrator, you can create a joined view from another user's layers; however, both layers must be owned by the same user and the resulting view will be owned by that user.
  • If the layer that you open to define the joined view (also called the target layer) contains attachments, the attachments from the target layer will be included in the joined view if the target layer contains a global ID field.

Follow these steps to create a joined hosted feature layer view:

  1. Sign in to your organization.
  2. Open Content > My content and open the item page for one of the hosted feature layers to include in the joined view.

    This layer is the target layer. Rows from the join layer you choose in step 5 will be appended to this layer.

    The layer must be a hosted feature layer, not a feature layer added from the web or a feature collection.

  3. Click Create View Layer > Joined view layer on the Overview tab of the layer's details page, or open the layer page for a sublayer and click Create View Layer > Joined view layer.
  4. Choose one sublayer for the target layer and click Next.
    Note:

    If the target layer is configured to show the user only the features created by that user, the joined view will provide feature access based on the creator values stored in the target layer. This means that users of the view will only see the features they created in the target layer.

  5. Specify the feature or table layer to join with the target layer.
    • If the layer is another sublayer in the same hosted feature layer as the target layer, choose the sublayer and click Next.
    • To choose a sublayer from a different hosted feature layer, browse to the hosted feature layer and click Add Add. If the hosted feature layer contains only one layer, click Next to proceed. If the hosted feature layer contains more than one layer, you must choose a sublayer before you click Next.
    Note:

    Even if the join layer is configured to show the user only the features created by that user, the joined view will not restrict feature access based on the creator values stored in the join layer.

  6. Choose the attribute field in each layer (the target layer and the join layer) to join the values in the two layers.

    If the join definition requires an additional set of fields, click Add field and choose additional fields from the target and join layers.

    Tip:

    Click the Information button Information next to a field to see a field's properties and what it contains.

  7. Define the join relationship.
    • One-to-one—With this option, only one row from the join layer will be joined with one row in the target layer. This means you must specify what that one row will contain—either the first row that matches the join condition or a calculated result of all the values in the join layer matched to a single row in the target layer. See Use one-to-one join options below for more information and steps for defining a calculation.
    • One-to-many—With this option, all the matching features in the join layer are joined to the target layer. The joined hosted feature layer view will contain multiple copies of the features from the target layer.
  8. To create a view that includes all rows from the target layer, even the ones that cannot be joined to rows in the join layer using the fields you specified, choose the Left join option.

    If you choose the Inner join option, the view will only contain the features in the target view that meet the join definition.

    For example, creating a joined view that contains city boundaries (target layer) and hospital points (join layer) joined by the city name in each layer, the Inner join option results in a view that contains only those city boundaries that have a hospital. Choosing the Left join option results in a view that contains all city boundaries, even those that do not have a hospital.

  9. After you define the join, click Next.
  10. Type a unique title for the joined hosted feature layer view.
  11. Choose the folder where the joined view will be stored.
  12. If your organization has set up content categories, click Assign categories and select up to 20 categories to help people find the item.

    You can also start typing a category name to narrow the list of categories.

  13. Optionally, type tag terms separated by commas.

    Tags are words or short phrases that describe your item and help people find your item when searching. Federal land is considered one tag, while Federal,land is considered two tags.

  14. Type a summary that describes the use and content of the joined view.
  15. Click Create to create the view.

The hosted feature layer view's item page appears when the joined view is created. If you click the Data tab, you'll find fields from the target and joined layer in the table. If you defined a calculation, the virtual field or fields created as a result of the join appear in the table with the target layer attributes.

Now you can share the view.

Use one-to-one join options

You can use one of the following options to define a one-to-one join:

  • Only keep the first matching record—The first record in the join layer that meets the join requirement will be included in the view. To control which record appears first, manipulate the sort field and order using the values on the Sort by and Sort order drop-down menus.

    For example, to pull in the hospitals with the greatest number of beds in each city, sort by the bed_number field in the hospital layer and use a descending sort order.

  • Summarize matching records—If there are multiple records in the join layer that match with one record in the target layer, you can define a calculation that performs a mathematical operation on a numeric or date field in the join layer, which will create a virtual field in the view that contains a single value for each matching record in the target.

    For example, you could join a feature layer of cities with the hospital layer based on the state name and calculate the minimum number of hospital beds in hospitals per city.

    When you summarize matching records, the count of the summarized records is included as a column in the view layer by default.

To define a calculation, do the following after you choose the Summarize matching records option:

  1. To specify the numeric or date field on which to perform the calculation, click Add statistic, choose the field, and click Done.
  2. Choose the type of calculation to perform on the field.
    • Sum—Adds together all values in the matching fields to create a total.
    • Min—Uses the minimum numeric value for the specified field.
    • Max—Uses the maximum numeric value for the specified field.
    • Mean—Calculates the average value for the specified field.
    • Standard deviation—Calculates the square root of variance relative to the mean value for the specified field.
    • Select all—Adds five virtual fields to the view; one for each of the calculations listed above.
  3. Proceed with step 8 in the previous section to finish creating the joined view.

Limitations of joined views

Keep in mind the following when using joined hosted feature layer views:

  • Joined hosted feature layer views cannot be used to edit data.
  • Joined hosted feature layer views cannot be used in offline maps.
  • You cannot define filters, define an area of interest, or restrict which fields are included in joined views.
  • You cannot alter the join definition for a view. To change which layers are in the view or change the join definition, delete the joined view and create a new one.

Hosted feature layer view settings

Settings for hosted feature layer views fall into three categories, as described in the sections below.

Settings inherited from the hosted feature layer that cannot be independently configured on the views

Hosted feature layer views inherit the following settings from the hosted feature layers from which you create them. When any of these settings change on a hosted feature layer, the settings also change on all its views; you cannot independently change these settings on the hosted feature layer view.

  • Multiscale geometry optimizations
  • Enabling or disabling attachments on individual layers
  • The ability to track who creates and edits data

    This is not applicable to a joined hosted feature layer view, because you cannot edit data in a joined hosted feature layer view.

  • For joined hosted feature layer views, the ability to restrict who sees features is based on the setting on the target layer and cannot be changed on the view.
  • Value lists and ranges

Settings inherited from the hosted feature layer that you can change on the view

Hosted feature layer views inherit the following from the hosted feature layer from which you create them. If you prefer a different configuration for the feature layer view, you can change the view's configuration without affecting the hosted feature layer.

  • Pop-ups and styles configured on the Visualization tab.

    These settings are not inherited in joined hosted feature layer views.

  • The layer's extent.
  • Item-level metadata.
  • Layer metadata.

    Hosted feature layer views inherit metadata from the primary hosted feature layer. If you never edit the layer-level metadata on the view, changes made to the metadata in the primary hosted feature layer will be seen in the view. Once you edit the view's layer-level metadata, edits are not synchronized between the view and the primary hosted feature layer.

  • Tags and categories.
  • The maximum cache age.
  • Field properties including the display name, description, field value type, and whether edits are allowed for the field.

    You cannot alter these settings on joined hosted feature layer views.

    Note:

    When you change these settings on a field in a hosted feature layer view, the field property in the view shows that it no longer inherits the setting from the source hosted feature layer. The field property overrides the source layer setting. If you later decide to revert to the settings that were inherited from the hosted feature layer, click Reset to source.

Settings that can be made independently on views and the hosted feature layers from which they are created

Hosted feature layer views do not inherit the following from the hosted feature layer from which you create them. Set these separately on the view.

For joined hosted feature layer views, the following additional settings are not inherited:

  • Pop-ups and styles configured on the Visualization tab.
  • The layer's extent.

Interdependent settings that are not inherited

Hosted feature layer views do not inherit the following settings from the hosted feature layer from which you create them. To enable these settings on the hosted feature layer view, you must first enable them on the primary hosted feature layer. To disable these settings on the primary hosted feature layer, you must first disable them on the hosted feature layer views.

These settings do not apply to joined hosted feature layer views.

Hosted feature layer views and data access

As the owner of hosted feature layers or an organization administrator, you must carefully consider the implications of enabling editing and take into consideration who has access to the layer. For example, if you enable editing on a layer that is shared with the public, anyone on the internet—even people who do not sign in to your organization—can edit the layer. In general, the more people who have access to a layer, the more restrictive the editing privileges should be on the layer. So unless you're creating a hosted feature layer with the express purpose of using it in a public-facing app to collect information, you should not enable editing on a feature layer you've shared with everyone.

Hosted feature layer views are ideal for helping you control access to the same hosted feature data; you can allow editing access to only those users who need it. You can make your hosted feature layer editable and share it with only those groups whose members need to edit the data. Then you can create hosted feature layer views from the hosted feature layer, don't enable editing on them, and share the views with more groups, the entire organization, or even the public without compromising your data.

See Data access and editing for an explanation of how combining views and different editing options can help you make the same data available to different types of users with different editing needs.

Considerations when creating hosted feature layer views

Keep the following in mind when you create hosted feature layer views:

  • If you need to refresh the data, you can swap the source hosted feature layer or overwrite the hosted feature layer from which the view was created.
  • Usage is tracked separately for hosted feature layer views; however, feature storage is not charged for feature layer views. Storage is only charged for the primary hosted feature layer or layers from which the view was created.

Related topics