Select to view content in your preferred language

Survey123 geopoint map not visible when using relevant filter

436
10
Jump to solution
12-03-2024 11:23 AM
AmyAlford
Emerging Contributor

I created a survey through Connect. I added a filter (${site_list="~NEW"} such that the geopoint question is only visible when a new location is being entered. However, the 'map' interface isn't visible in the survey. One must click on the AmyAlford_0-1733253567739.pngicon to render the map in a new window. I tried several iterations to see where the issue is coming from and it appears to be only when there is a relevant filter set. I've attached an example xlsform. I'm using v3.19. 

 

0 Kudos
1 Solution

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

When you open the survey form to collect data, the device will immediately capture location data. Geopoints will have a point location and geotrace or geoshape will centre on your location but not start drawing.

The issue with the relevant is that the question is not there when the form loads, so the location capture does not prepopulate the geopoint with the initial opening. In @abureaux's case when using body::esri:visible, the question is 'there', just invisible, so it calculates on form load. This resolves the issue partially but is problematic as it will always capture the location data. That would be bad for Inbox editing.

In both the above examples, the map won't appear if the users location is not accessible to the Survey123 field app i.e. you've denied it in device settings.

Using your Form provided:

  • Add the word position to the default column. I understand this will invoke a similar behaviour to the form load (noting that defaults otherwise don't usually apply when editing in inbox) 
  • Ensure the survey123 field app has location access on your device
  • The location will now default to the users position when the question becomes relevant, for both collecting and using the Inbox. At least in my testing. Without the position keyword, the location is not preset for collect/inbox.

If you do not have GPS enabled the users will need to interact with the question. You might see this on Survey123 Connect or your device if location access is not allowed. Should be easy enough to test on another survey without the relevant.

There may be some world where you can have a default value to show a map e.g. centre on xy with a calculatiodMode=whenEmpty but I think this would be a disaster as you'd be prefilling the question with the same location time and time again.

I don't believe it's possible to show the geopoint question without the point on the map in the field app. So you need to default the GPS at your users location through the form open, position keyword in default, or a calculation to preset it.

Otherwise... not the end of the world for users to click a button?

View solution in original post

0 Kudos
10 Replies
ChristopherCounsell
MVP Regular Contributor

Website or field app?

My understanding is the map won't appear until it has a location value. It could be that the relevant filter is preventing the user's location from loading or populating the map.

Try adding a default or calculated location to the geopoint question. If you want the users current location, add the word position to the default column. It'll default to the users GPS if available.

0 Kudos
AmyAlford
Emerging Contributor

This issue only occurs in the app (desktop and mobile). It automatically displays the map interface once the user chooses '~NEW' in the browser version. However, our functionality requires the user to use the app as we have Inbox active. 

0 Kudos
abureaux
MVP Frequent Contributor

One must click on the icon to render the map in a new window

This is expected behaviour with this set up.

Have you considered using body::esri:visible? It works the same as relevant, but the element hidden still exists even when not visible.  You need to take this into account though if you are expecting hidden elements to return "null" values, since they will contain data like normal.

0 Kudos
AmyAlford
Emerging Contributor

Using body::esri:visible in place of relevant provides the same result. If it is expected behavior, why does it display the map interface in the web browser version of the survey but not in the app version?

0 Kudos
abureaux
MVP Frequent Contributor

Web interface is a very different application. While the underlying elements are the same, the Web and Field Apps handle these same elements differently.

That said, when I swap to body::esri:visible, I get this

abureaux_0-1733261441710.png

As compared to relevant (again, this is what I would expect from a geopoint shown by a relevant statement):

abureaux_1-1733261494240.png

 

 

0 Kudos
AmyAlford
Emerging Contributor

Hm, I'll have to see what the issue is because when I use ${site_list}='~NEW' in body::esri:visible and not in the relevant column, I'm still not replicating what you have presented in the app and still not seeing the map. 

0 Kudos
abureaux
MVP Frequent Contributor

Here is the file I'm using for get that behaviour (attached).

Note that I am using the most recent versions of the Field app and Connect. Using older versions may have a different result. If you install Connect and Field App through the Microsoft Store, they will be auto-updated.

0 Kudos
AmyAlford
Emerging Contributor

Thanks, it was user error on my part by still leaving the relevant field complete!

0 Kudos
ChristopherCounsell
MVP Regular Contributor

When you open the survey form to collect data, the device will immediately capture location data. Geopoints will have a point location and geotrace or geoshape will centre on your location but not start drawing.

The issue with the relevant is that the question is not there when the form loads, so the location capture does not prepopulate the geopoint with the initial opening. In @abureaux's case when using body::esri:visible, the question is 'there', just invisible, so it calculates on form load. This resolves the issue partially but is problematic as it will always capture the location data. That would be bad for Inbox editing.

In both the above examples, the map won't appear if the users location is not accessible to the Survey123 field app i.e. you've denied it in device settings.

Using your Form provided:

  • Add the word position to the default column. I understand this will invoke a similar behaviour to the form load (noting that defaults otherwise don't usually apply when editing in inbox) 
  • Ensure the survey123 field app has location access on your device
  • The location will now default to the users position when the question becomes relevant, for both collecting and using the Inbox. At least in my testing. Without the position keyword, the location is not preset for collect/inbox.

If you do not have GPS enabled the users will need to interact with the question. You might see this on Survey123 Connect or your device if location access is not allowed. Should be easy enough to test on another survey without the relevant.

There may be some world where you can have a default value to show a map e.g. centre on xy with a calculatiodMode=whenEmpty but I think this would be a disaster as you'd be prefilling the question with the same location time and time again.

I don't believe it's possible to show the geopoint question without the point on the map in the field app. So you need to default the GPS at your users location through the form open, position keyword in default, or a calculation to preset it.

Otherwise... not the end of the world for users to click a button?

0 Kudos