PROBLEM
Performing queries on feature layers fail when accessed anonymously in ArcGIS Online or Portal for ArcGIS web apps, even if the feature layers, view layers, or web maps are shared publicly. For example, pop-ups and attached images do not display in the web app even though both the layer and the web app are public.
The dashboard below demonstrates the image attached to the related table not displayed when accessed anonymously.
The web app is using feature layers or view layers created from ArcGIS Survey123, and the item setting for the layers is set to disable any form of query on the layer. When the 'What features can editors see?' setting is set to 'Editors can't see any features, even those they add', the allowAnonymousToQuery parameter for these feature layers is set to false, preventing queries from being performed without signing in to ArcGIS Online or Portal for ArcGIS organizations. This parameter can be found in the feature layer's JSON script in the ArcGIS REST Services Directory.
The image below shows the allowAnonymousToQuery parameter set to false in a feature layer's JSON script in the ArcGIS REST Services Directory.
On the Settings tab of the hosted feature layer, in the Feature layer (hosted) section, ensure the following parameters are enabled and save the configurations.
An additional step is required when a view layer is used in a web app. Update the view layer settings after configuring the source layer settings. On the Settings tab of the view layer, in the Feature layer (hosted, view) section, click Update View. For more information, refer to ArcGIS Online: Edit a hosted feature layer view definition.
Set the allowAnonymousToQuery parameter to true in the feature layer JSON script.
The dashboard below demonstrates the query performed on the feature layer as the image attached to the related table is displayed in the pop-up when accessed anonymously.
Article ID: 000031402
Get help from ArcGIS experts
Download the Esri Support App