In the Coronavirus Response solution, if I add custom fields to the Cases feature layer, do I have to recreate the three feature layer views from scratch? It does not seem you can update the views with new fields on the source feature layer.
Solved! Go to Solution.
Summarizing in one comment. Hopefully that's useful!
When adding a new field to the Cases feature layer the new field will need to be accounted for on the views created from the Cases feature layer. Getting the new field on the view depends on the type view:
To get that new field on Cases_current it will need to be recreated:
Cases_current or something similar.
Layer to join to the target layer:
Fields to match:
name = name
Join one to one
Define which record is kept:
Order by Date Reported / Sort by Newest
I'm dealing with this today as well. From what little I know about hosted layer views, you cannot alter the schema of the view to include new fields from the source layers, so you have to recreate them all. To make it more complex, the 'Cases Current' hosted view does some aggregation from the cases table to the related boundaries layer, so that you have one table with the most recent counts for each boundary. The view was created by Esri's solution so I don't know you can see the code for how the join is done, let alone recreate it.
Hoping to get some answers this afternoon. I'll share here if I find out some tricks
I just heard back from Esri:
To [re]create the [Cases Current] view add the Cases feature service to the map viewer. From Analysis open the Join Features tool. Configure your settings for the join and at the bottom check the option to save the output as a hosted view.
To define the join you will do a 1:1 attribute join based on the name field, and sort on the Report Date field in descending order.
You still have to manually recreate all the views, but I hope that helps.
Thanks Andrew! I'm going to try to summarize. The Cases hosted feature layer has three views defined on it:
Cases_public is just a basic view of Cases with editing turned off in Settings. You can recreate it with the Create View Layer button and don't need to change the View Definition.
Cases_reporter - as above but with editing turned on.
Cases_current - as you describe above, recreate in Map Viewer with a join. It seems that target layer is "Cases", layer to join is "Cases - Cases", match fields where name = name, join one to one, order by Date Reported is Newest, save as a feature layer view.
You have to edit the Case Reporter form in Survey123 Connect. Add your new field names on the first sheet (don't forget the esriFieldType), and change the id in the submission_url in the Settings sheet.
Then you need to replace the Active Cases layer in the Community Impact Dashboard map with your new Cases_current view (might want to update the URL of the service using ArcGIS Online Assistant).
Then you might want to reconfigure the "Community Impact Dashboard" dashboard.
I think I have that right.
Cases_current is a hosted join view and unfortunately there is no way to expose a new field added to one of the join view's sources. So that view would need to be recreated to pick up a new field. Andrew outlined that process well above: