Select to view content in your preferred language

Cannot enter location on browser, works on app

439
10
Jump to solution
4 weeks ago
dsinha
by
Frequent Contributor

Hello,

I created a survey using Connect, but want to collect data using the browser.

The geopoint question requires the responder to drop on the point on the map, but when I click on the survey map in the browser, nothing happens. When I do the same operation on Survey123 app (android), it works fine.

Any idea how to fix this?

Thanks!

0 Kudos
2 Solutions

Accepted Solutions
dsinha
by
Frequent Contributor

Thanks @Neal_t_k, took your suggestion to pass on the constraint validation to different fields using this example

Now its working in the browser version.

View solution in original post

0 Kudos
Neal_t_k
Frequent Contributor

You could set  bind::esri:fieldType = null for that question, if you don't need to capture it.  Then you don't have to worry about it.

View solution in original post

10 Replies
Neal_t_k
Frequent Contributor

Can you share any more details or screen shots of the behavior? Can you still pan/zoom the map? Are there any calculations on the geopoint question?

0 Kudos
dsinha
by
Frequent Contributor

Hello @Neal_t_k 

The following are the settings on the geopoint:

  • appearance: press-to-locate
  • default: null
  • constraint: pulldata("@layer", "getRecordAt", "https....", ${location}) (appears as blue outline polygon on the map)

Despite these settings, the map attempts to detect the location of the device.

dsinha_0-1762352427757.png

Gives more error messages when it shouldn't.

dsinha_1-1762352658000.png

Then when I try to click within the blue line to drop a point, this is what happens. 

Thanks for your help.

0 Kudos
Neal_t_k
Frequent Contributor

It appears your constraint isn't setup quite right according to the following post: https://community.esri.com/t5/arcgis-survey123-questions/constraining-a-geopoint-answer-to-a-given-a...

getRecordAt pulls a json  so you either need another helper to pull the attribute you wish to match or include it in your pulldata: pulldata("@layer", "getValueAt","attributes.YOURFIELDNAME", "https....", ${location})

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-pulldata-quot-laye...

Then you need to match it to something. So if I am understanding correctly, you should move the pulldata into a helper field.  Create another helper field for your match, I am guessing it could be static. And then in your constraint, set the two helper fields equal to eachother

helperfield1 = "MatchingTermtoPolygon"

helperfield2 = pulldata("@layer", "getValueAt","attributes.YOURFIELDTHATMATCHES", "https....", ${location})   with location will be your geopoint question.

then in the constraint ${helperfield1}=${helperfield2}

Hope that makes sense.

 

0 Kudos
dsinha
by
Frequent Contributor

Thanks @Neal_t_k. I did look through the posts that you shared before I started working on this solution.

I modified the getRecordAt expression because I was not trying to pull any value from the polygon layer, but only to use it as a kind of geofence. And, as I mentioned, it works in the Survey123 mobile app without any problem but fails to work in the browser version.

I will try to figure out how incorporate the original expression and make it work.

0 Kudos
Neal_t_k
Frequent Contributor

@dsinha So you just want to make sure that the capture is inside the blue line.  what if you did something like this:  

constraint: string-length(pulldata("@layer", "getValueAt","attributes.ANYFIELD", "https....", ${location}))>0

I changed it to getValueAt instead of getRecordAt, and you should be able to put any field that is not null. This should pull the content of a field and evaluate as greater than 0 if inside the polygon and should evaluate as 0 if outside the polygon.

0 Kudos
Neal_t_k
Frequent Contributor

@dsinha Did some further testing, the constraint in the geopoint question is causing your original issue, if you remove it, it should work,  Then you will have to configure a constraint on a separate note field, it should act the same, not letting a user submit until the constraint is validated.

Edit: Added Example (Could use some fine tuning, but should be working)  I used a watershed polygon feature for an the example. If in the US should work,  outside of US should trigger the constraint.  https://www.arcgis.com/home/item.html?id=5bbefdcd2511472ea9abd0afedb85c7e

dsinha
by
Frequent Contributor

Thanks @Neal_t_k, took your suggestion to pass on the constraint validation to different fields using this example

Now its working in the browser version.

0 Kudos
dsinha
by
Frequent Contributor

Just wanted to add that I ran into a "Failed to submit error". Followed the suggestion here and set bind::esri:fieldLength to 50000 for the first pulldata field, and the error disappeared. 

0 Kudos
Neal_t_k
Frequent Contributor

You could set  bind::esri:fieldType = null for that question, if you don't need to capture it.  Then you don't have to worry about it.