Pop up categories not syncing between survey123 and ArcGIS Online map

232
5
Jump to solution
a month ago
JenMcRuer
New Contributor II

Hello, 

I have created and amended a Survey123.  

All original & new survey question categories are visible in Survey 123 survey & data; as well as on ArcGIS online data and ArcGIS online map 'configure fields' list. However, the two new new categories created are not visible in the ArcGIS online map 'configure pop up' fields list. Hmmmm....

Any suggestions?

Thanks!

0 Kudos
2 Solutions

Accepted Solutions
UriGilad_EsriAu
Esri Contributor

Hi @JenMcRuer,

Did you try to add the layer again to the map after adding the questions?

A map layer schema doesn't change if you modify the schema after you added the layer to the map.

Try to add the layer again and see if the new fields are visible. You might have to remove the old layer and configure the pop-up on the new layer.

Hope this helps,

Uri

If this answer solved your question or if you found it helpful please mark it accordingly to help others who have the same question.

View solution in original post

DougBrowning
MVP Frequent Contributor

I have reported this to Esri in the past and they say it should find the new fields, but it usually does not.  Esp in big services.

When it does work you have to go in and turn the fields on in the pop up.  And they are usually way at the bottom of the list.  So they are there just turned off by default.  Try that.

If not then you have to rebuild the map every single time.  It causes us hours and hours of extra work since our popups are complicated.  I have 32 Arcade expressions in one. 

Good luck

View solution in original post

5 Replies
UriGilad_EsriAu
Esri Contributor

Hi @JenMcRuer,

Did you try to add the layer again to the map after adding the questions?

A map layer schema doesn't change if you modify the schema after you added the layer to the map.

Try to add the layer again and see if the new fields are visible. You might have to remove the old layer and configure the pop-up on the new layer.

Hope this helps,

Uri

If this answer solved your question or if you found it helpful please mark it accordingly to help others who have the same question.

View solution in original post

UriGilad_EsriAu
Esri Contributor

Hi @JenMcRuer@DougBrowning,

I wrote this quick script to copy pop-ups between web map layers. It's published here:

https://community.esri.com/t5/arcgis-online-blog/copy-pop-up-between-web-map-layers/ba-p/1073105

Hope you find this helpful, 

Uri

DougBrowning
MVP Frequent Contributor

Thanks a lot for this!  I had played with the JSON before but did not try it like this.  I really did not think it would copy the Arcade but it did.  Also it seemed to even pick up the decimal place settings. 

Looks like no labels though?  I wonder what else is missing?

One note is I cannot store any usernames so I do this to just grab my Pro login in the backend.

#gis = GIS(account,username, password)
gis = GIS('pro')

Then I modified it so it will copy any matching layer names it finds between two web maps since that is how I will use it.

Here is the code

# CopyAllPopupsFromMaptoMapAGOL.py
# This script copies the popup from any layers in the source that are found in the target
#   Matching is done by layer name
# User to provide the following inputs:
    # web map 32-character id for both the source and target web map.

### WARNING: THIS SCRIPT WILL COMPLETELY REMOVE THE EXISTING POPUP FROM THE TARGET LAYER AND ASSIGN IT WITH THE SOURCE LAYER POPUP ###

# Created 6/28/2021
# Modified 6/28/2021
# Modifed to copy all layers that match names from one web map to another

############## USER INPUTS ###################################################################

account = 'https://www.arcgis.com' # AGOL/Portal url
# using Pro instead
##username = 'yourusername' # AGOL Username
##password = 'yourpassword' # AGOL password
webmap_id_source = '13a149dee626666666666669bc68' #  32-character id of web map with the source layer
webmap_id_target = '9f5d499666666666666666574af2' #  32-character id of web map with the target laye

##############################################################################################

### EXECUTE ###

#Import
from arcgis.gis import GIS
from arcgis.mapping import WebMap
import sys

print("Starting")

# Check layers names and web maps are not identical
if webmap_id_source == webmap_id_target and copy_popup_from_this_layer == paste_popup_to_this_layer:
    sys.exit("Script cancelled: Source and Target layers have the same name and are within the same web map. Please rename one layer before continuing")

#Connect to GIS
#gis = GIS(account,username, password)
gis = GIS('pro')
source_webmap = gis.content.get(webmap_id_source)
target_webmap = gis.content.get(webmap_id_target)

# Get a list of layers in both web maps
web_map_obj_source = WebMap(source_webmap)
web_map_obj_target = WebMap(target_webmap)
layers_sourceWM = web_map_obj_source.layers
layers_targetWM = web_map_obj_target.layers

# Loop through all the source layers and copy to the matching targets
for sourceLayer in layers_sourceWM:
    found = 0
    for targetLayer in layers_targetWM:
        if targetLayer.title == sourceLayer.title:
            targetLayer.update({'popupInfo':sourceLayer.popupInfo})
            found += 1

    if found == 0:
        print("Warning did not find layer " + sourceLayer.title + " in the target map")
    elif found > 1:
        print("Warning found the source layer " + sourceLayer.title + " " + str(found) + " times in the target map")
    else:
        print("Copied " + sourceLayer.title)

# Update/save webmap
web_map_obj_target.update()

print("Finished")

Big thanks @UriGilad_EsriAu  this may really save us some time when we do 12 state rollouts.

DougBrowning
MVP Frequent Contributor

I have reported this to Esri in the past and they say it should find the new fields, but it usually does not.  Esp in big services.

When it does work you have to go in and turn the fields on in the pop up.  And they are usually way at the bottom of the list.  So they are there just turned off by default.  Try that.

If not then you have to rebuild the map every single time.  It causes us hours and hours of extra work since our popups are complicated.  I have 32 Arcade expressions in one. 

Good luck

View solution in original post

JenMcRuer
New Contributor II

Thank you for this, @DougBrowning, and @UriGilad_EsriAu 

Perhaps it was my blurry eyes . . . inside the 'configure pop up fields' window there is a space to add a title, description, and then it says 'Select fields' followed by the list of attributes. I thought 'Select fields' was describing the subsequent list (the 'active' attributes, if you will), and was not a button. Once I thought to click, sure enough, the 'turning on and off' options were there. And as you said, @DougBrowning they go to bottom of the list.  Would be great to have even have a title change here: instead of 'select fields' 'turn fields on/off", for clarity

*Speaking to reducing time and effort:  I have a few suggestions for the ArcGIS team regarding popup configuration (unless I'm missing something!): 1. to make the process of ordering attributes up and down the list a scrolable process (Currently, the number of spaces you can move up and down is limited by the window size (approx 8 attributes displaying); so the process is to drag the attribute every 8 spaces. drop. scroll up. drag eight spaces. drop. scroll up.... making this a very tedious process if, like me, you have 58 attributes. 2. it would be great if you could move multiple attributes up or down at the same time AND 3. if the list could be automatically ordered in the order of, say survey questions, for example (then rearranging would be less tedious)

Thanks again for your help. Very happy to have the ESRI community knowledge and experience at hand.