Geoshape and scripts disabled

250
6
06-24-2021 03:37 AM
LieslDe_Swardt1
New Contributor II

Hi Everyone,

I have created a survey through survey 123 connect using version 3.12. The goal is to capture certain information for specific properties. However the enumerator must capture the correct information for the correct property, I've therefore used geoshape and geopoint so the person can see his location. However, the polygons are not pulling in on the map, and I'm also struggling with the pulldata and the script. I've added the featurelayer (with all the polygons) manually to the web map that gets created once the survey is published, but I've been told that it would be static. The survey must be public, and hence I'm getting an error on the output that scripts are disabled. I'm just failing 100% all round. Hoping that someone can help me. Below a screen shot, and attached my excel and script file. Please note that I am extremely new to scripting.

LieslDe_Swardt1_0-1624530265577.png

 

0 Kudos
6 Replies
DougBrowning
MVP Frequent Contributor

Javascript is disabled on Public surveys on purpose due to it being a security risk.  They are looking to open it up in the next version and it is in beta now but it looks like it may stay blocked.  I tried to copy it in here but can't here is the link.  https://earlyadopter.esri.com/project/article/item.html?cap=e69ef91f45744b98882c651f7b518eb7&arttype... 

 

Original post saying it is disabled  https://community.esri.com/t5/arcgis-survey123-blog/extending-survey123-smart-forms-with-custom-js-f... 

 

The other issue is there can only be one geometry in a form.  In  AGOL/ Geodatabase a feature class is a point, polygon, or polyline.  You cannot have a point and a polygon in the same layer.  That would be like having a file that is both a word doc and an excel sheet.  If you have a polygon no real need for the point.

Hope that helps

0 Kudos
LieslDe_Swardt1
New Contributor II

Thanks very much. I will have a look at the links you've shared, and hope there is a workaround for javascript then.

 

I actually do need both, the point is the live location of the enumerator, and he needs to see the polygons on the survey so he can capture for the correct polygon. He doesn't need to edit or draw polygons hence I made the geoshape read only (but it doesn't pull onto the map). Will check if the polygons draw if I remove the geopoint. Thanks.

0 Kudos
DougBrowning
MVP Frequent Contributor

Not sure what you mean by bring in the shape to the map.  If you want to show shapes on the map you would use linked content.  At least I have never seen it done this way.

The better way to do it IMHO is to have a map in Field Maps/Collector that has all the shapes.  The users uses this to navigate to it.  Then have launch links that pass the ID to the form so they are linked.  I can post more on how to do this if you need it.  This works the best if you are going to be offline.

I also see you are using 2 diff reserved words.  The little green marks are telling you these are not valid - cannot ignore them.  The reserved word sheet in excel has the list.

DougBrowning_0-1624544531068.png

Hope that makes sense

0 Kudos
LieslDe_Swardt1
New Contributor II

No I thought it was possible with the linked map for a person to click on the polygon they are capturing data for and have some info pulled into the survey from that specific polygon. I just need some way to be able to link the data to the correct polygon. I know the point/location of the enumerator will help with that, but a secondary verification would be amazing. Unfortunately we do not have an enterprise license or fieldworker licenses for Collector, as that would have been ideal. We have over 250 000 enumerators and 600 000 portions, hence the second verification method so that we don't mess up when we link the data captured in the field to the portions' attribute table.

Thanks for the heads up on the reserved words.

0 Kudos
DougBrowning
MVP Frequent Contributor

Linked content can be viewed but I am not sure about clicked on.  Someone else may know.

Just today this came which may help.  Need to sign up for early adoptor

https://earlyadopter.esri.com/project/article/item.html?cap=e69ef91f45744b98882c651f7b518eb7&arttype...

 

0 Kudos
IsmaelChivite
Esri Frequent Contributor

@LieslDe_Swardt1 

Another approach you could try is to work with the Inbox.

Create a survey with a geoshape question. Include in the survey the questions that you will use for reference as well as those that end users are supposed to complete. Make sure you set the instance_name expression as it will be used to label your polygons in Survey123.

When you publish your survey, a polygon layer will be created. Then use 'Append' in ArcGIS Pro or from ArcGIS Online to add your polygons into the survey layer.

Back in your survey, enable the Inbox in Connect (and disable the Sent folder). Publish again.

In the Survey123 field app, Refresh the Inbox to load all the polygons into the app. You can now select a polygon from the map or the list. The location of the user can be used to sort polygons in the list by distance to your location, or to center the map.

As you select the polygon, a survey will open with all the information you have associated with the polygon. Make changes and submit. The polygon will dissapear from your Inbox so you can continue working with other polygons.

Tip: In survey123 Connect you can define a query to filter elements downloaded into the Inbox. For example, you can use a filter like status='pending' (if you have a status field...).

This video is pretty old and the UX does not correspond 100% to what things look like today, but it should be useful to follow the steps: https://www.youtube.com/watch?v=aGTPIzTtbSk

 

Additional notes:

* Using custom JS functions in public surveys is not possible. We wanted to enable them for public surveys, but it will not be possible due to security risk.

* The Inbox does not work in 3.12 with public surveys, BUT it will work with 3.13. This is a new feature we are adding.  If you want to try 3.13, it is available in the Survey123 early adopter website.

* I totally agree with @DougBrowning : No need to add a geopoint question to your survey

 

0 Kudos