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.
Hi Kelly, I just wanted to report that I am also having this issues with Zone Lookup, which I usually fairly regularly to plop into other tools I build out with Experience Builder. Do you have a general estimate on when this will be patched?
The issue with related records disappearing should be fixed in ArcGIS Online after the release on Wednesday night. Are you still seeing it in your app? If so is your app public and can you share the url?
The problem still persists. I'm unfortunately unable to share the app because of confidentiality requirements. When selecting a polygon in the map, the Zone Lookup instant app now filters out all the other features from the map, which breaks associated statistics. There does not appear to be an option to disable hiding the unselected results within the selected feature. It still reports all of the data that's contained within the polygon in the Results widget, it just hides the visibility of everything except what was selected in the map, and thus fails to produce the appropriate associates statistics. None of the configuration options seem to resolve this. It worked as expected prior to the update.
Can you share the configured info for the app - that might help us be able to setup a reproducible test case. You can get the JSON to share using dev tools like the Chrome developer tools. Here is info on how you open the dev tools. https://developer.chrome.com/docs/devtools/open
Once open you can look for the network tab then paste your appid in the filter section and click the Fetch/XHR option to only see those requests. If you click on the request with your appid you can copy the response and either send it to me via direct message or paste it here.