Re-use a Smart Form?

623
7
05-17-2023 08:43 AM
compass_cartographic
New Contributor III

I have an extensive hosted feature layer (points) which I would like to split up into separate hosted feature layers so field crews can work in different areas with individualized field maps based on zones / regions / neighborhoods.   Am I missing a way to make one Smart Form and apply it to / within different hosted feature layers / different field map apps?  The hosted feature layers will all have the exact same attributes.  I'd just like to avoid having to create a redundant smart form over and over again, or make a few hundred bookmarks for the zones.  Working in Portal with a Map made in Map Viewer (not classic).  Other ideas welcome (copy a json file? / use AGOL Assistant? )!  And thank you!

Tags (2)
0 Kudos
7 Replies
ClayDonaldsonSWCA
Occasional Contributor II

Updating the web-map JSON via agol assistant is certainly an option.

Alternatively, the less tedious option would be using the argis python api 

FormCollection | ArcGIS API for Python

arcgis.mapping module | ArcGIS API for Python

 

0 Kudos
compass_cartographic
New Contributor III

Thank you for responding with these helpful links.  I will give it a try!

MiltonSolano
Occasional Contributor

For all my form reuse tasks, I always go to AGOL Assistant. Here's the link:

https://ago-assistant.esri.com/

It's an easy interface and I find it very convenient with reusing already defined popups, forms and all the whistles. I didn't know about the FormCollection interfaces. Thanks for sharing.

Mjss25

0 Kudos
Tiff
by
Occasional Contributor III

Hello! How do you use AGO assistant for this workflow? Are you able to carry over the same questions/calculations/etc. across different layers?

0 Kudos
MiltonSolano
Occasional Contributor

@Tiff,

If I need to replace a hosted feature layer in a webmap where all the popups, forms, defined editing-rules are already present, I do the following (understanding the new hosted feature layer contains the same attributes as the old one, except is a new geographic view or query):

  1. Create a copy of your "original" webmap. The copy will be replaced with the new hosted feature layer (the view).
  2. Annotate the URL for the new hosted feature layer you need to replace.  Usually is in the form of "https://services2.arcgis.com/HRY6x9wt5qjGnAA9/arcgis/rest/services/View_Tree_Census_Liana_view/Featu...". You'll replace the old URL one with the new one.
  3. Open the Agol assistant.
  4. Load the copied target webmap and select the option "View and item JSON"
  5. The window with the webmap content will have two sections: description and data. Search on the data section for the "operationalLayers" tag. This tag contains all the hosted feature layers present in the current webmap.
  6. Search the hosted feature layer you'll like to replace. You'll notice it contains all the webmap definitions, like formInfo, showLabels, layerDefinition, popupInfo, etc.
  7. Replace the old URL tag section with the new one you have.
  8. Save the Json definition.
  9. Open the saved webmap on the mapviewer or Field Maps and you'll have the new feature class with all the layer definitions correctly applied.

Hope this helps,

Cheers,

MJ

0 Kudos
Tiff
by
Occasional Contributor III

Ahh got it. Thanks @MiltonSolano ! I think my Field Maps configuration will contain several of the same questions/fields, but not fully identical - so each layer would have configurations unique to that layer that I still need to retain. Have you tried just the "formInfo" "formElements" part of the JSON to transfer over to different maps? I believe I tried that once and it was tricky with the parentheses and didn't work perfectly.

0 Kudos
MiltonSolano
Occasional Contributor

Yes,

For some webmaps, I just collapse the formInfo tags, copy this particular section only and paste it into another webmap and start editing from there, leaving everything else as it is. I think the tool allows you to copy/paste whatever json tags you need. Obviously, you need to be aware of the opening/closing parentheses. It takes a little practice but once learned, it's really helpful.

Good luck!

MJ

0 Kudos