Hi,
Does anyone know how to get both an address search (geocode) and map selector (press-to-locate) on the same form?
I am trying to provide two different options for my residents to select a location. Either using the geocode search appearance which will let them type in an address or using the map selector. If I put both into the appearance field, then it defaults to just entering an address. If I try to use a calculation or reference a calculated value, then it defaults to press-to-locate. If I have two geopoint types in the same survey conditional on what the user picks I can't publish. I also can't have a repeat question to allow for two geopoints because this is built on an existing service. And I know that they can search for an address in the map but it is not as slick as the geocode address search so I would like to default to that if possible.
Any insight would be helpful.
Many thanks 🙂
Solved! Go to Solution.
Hello @BenSperry,
You'll need to do some trickery with the `null` bind::esri:fieldType. You can only have 1 geometry question submit data per layer so essentially you'll need to make questions null and then have another that calculates the geometry and is ultimately submitted.
Based on your screen capture it looks like you're mostly there. Try setting Loc1 and Loc2 to null in the bind::esri:fieldType, change Location to a geopoint with a hidden appearance and don't set that field type to null.
If you're interested you should also be able to change the Location calculation to coalesce(${Loc1}, ${Loc2})
Hello @BenSperry,
You'll need to do some trickery with the `null` bind::esri:fieldType. You can only have 1 geometry question submit data per layer so essentially you'll need to make questions null and then have another that calculates the geometry and is ultimately submitted.
Based on your screen capture it looks like you're mostly there. Try setting Loc1 and Loc2 to null in the bind::esri:fieldType, change Location to a geopoint with a hidden appearance and don't set that field type to null.
If you're interested you should also be able to change the Location calculation to coalesce(${Loc1}, ${Loc2})
Hello Zach,
Thank you for your timely advice. Setting the extra geopoints to null indeed allowed me to publish successfully.
Here are a few notes for any readers who may come later:
Here is my final working section:
Thanks again, Zach, for your help!
Best regards,
Benjamin