Hello community!
I have developed a Zone Lookup Instant App for our Department of Elections, to show designated polling places and early voting sites. The app has worked quite well, though in the process of updating the data, I noticed a peculiar issue with the returned results.
The data and the app are both hosted in AGOL. There are 2 sets of related layers, both of which are a polygon layer and the related points. When selecting an address within the tool, it correctly returns the multiple early voting sites and the designated polling places, which are related records. If either individual result is selected from either set of results, the opposite set of results disappear.
Here is the public Instant App: https://gis.elections.delaware.gov/apps/5bc1fa9352464944be601441655e36a0/explore
Test address: 148 John Hunn Brown Rd, Dover, DE 19901 (local Target store)
Search results correctly show 1 polling place and 4 early voting sites.
If I select one of the early voting locations, the polling place results disappear.
The app needs to be refreshed in order to research the address. Once I get the results again, I select the single polling place, and the early voting results disappear. And once again, the app needs to be refreshed to see the other results.
The app worked perfectly earlier this year, and both sets of results would display no matter which result was selected. I can only assume that it may have broken after the last AGOL updates, as the app owners have not mentioned any issues.
Is anyone else with a similar Zone Lookup Instant App experiencing the same issues? I'm happy to discuss the specific settings of my application to determine if this is a setting issue, or an app issue after the last AGOL updates.
Thanks!
Solved! Go to Solution.
Sorry for the delay in responding. It looks like an issue with the logic for related records and we'll get it fixed in the next release of online. In the meantime as a workaround you could write an arcade expression that shows the designated polling place related record content directly in the popup. In my testing this does not disappear after clicking the related record. Here's the arcade I used to test it out.
var relatedRecords = FeatureSetByRelationshipName(
$feature,
"BND3_PollingPlace_ED_to_Locations"
);
var firstRelatedRecord = First(relatedRecords);
console(firstRelatedRecord)
var encodedAddress = UrlEncode((firstRelatedRecord.POLLING_PLACE_ADDRESS))
var baseUrl = `https://www.google.com/maps/search/?api=1&query=${encodedAddress}`;
var displayAddress = `${firstRelatedRecord.ADDRESS}<br>${firstRelatedRecord.City},${firstRelatedRecord.STATE}${firstRelatedRecord.ZIP}`
return { type: "text", text: `<b>${firstRelatedRecord.POLLING_PLACE_NAME}</b><br><br><a href=${baseUrl}> ${displayAddress}</a><br><br> <i>Click on address to open polling place in Google Maps</i>` };
Sorry for the delay in responding. It looks like an issue with the logic for related records and we'll get it fixed in the next release of online. In the meantime as a workaround you could write an arcade expression that shows the designated polling place related record content directly in the popup. In my testing this does not disappear after clicking the related record. Here's the arcade I used to test it out.
var relatedRecords = FeatureSetByRelationshipName(
$feature,
"BND3_PollingPlace_ED_to_Locations"
);
var firstRelatedRecord = First(relatedRecords);
console(firstRelatedRecord)
var encodedAddress = UrlEncode((firstRelatedRecord.POLLING_PLACE_ADDRESS))
var baseUrl = `https://www.google.com/maps/search/?api=1&query=${encodedAddress}`;
var displayAddress = `${firstRelatedRecord.ADDRESS}<br>${firstRelatedRecord.City},${firstRelatedRecord.STATE}${firstRelatedRecord.ZIP}`
return { type: "text", text: `<b>${firstRelatedRecord.POLLING_PLACE_NAME}</b><br><br><a href=${baseUrl}> ${displayAddress}</a><br><br> <i>Click on address to open polling place in Google Maps</i>` };
Hi Kelly! Thank you so much for looking into this and confirming that it is an issue behind the scenes. I appreciate you including the Arcade code to pull the related records from the original layers. This looks like the original Arcade code I would use prior to the incorporation of related records into apps.