Views with new Cases fields

3106
13
Jump to solution
03-19-2020 08:17 AM
KevinMayall
Occasional Contributor III

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.

Kevin
13 Replies
AndrewRudin1
Occasional Contributor II

FYI to everyone that you can't change the view definition for the cases standalone table from the visualization tab of the view. That tab only shows the layers with geometry and hides layers that are simple tables.  So you have to add the view to a map, click the table in the contents and then click "set definition".  

SteveMulberry
New Contributor

Mike, are you sure you don't mean a 1:Many attribute join? 1 report area to many case reports. When I do a 1:1 I don't see additional records.

Also, I've gone through all these steps and everything seems to be working except the dashboard. Survey collects data from the new field and I can see the data in the Web Map. But when I go to update the configuration of the dashboard the indicator elements just spin trying to find the layer never coming back with no-data or not configured message.

Thanks

0 Kudos
MikeDagle
Esri Contributor

Hi Steve,

It's a 1:1 join because with Cases_current we're only returning the most recent case report from the Cases table, which is why after when doing a 1:1 join we see the Define which record is kept option and set that as Order by Date Reported, Newest. 

Re: the dashboard. Unfortunately, the indicators you reference as spinning (and the dropdown) will need to be deleted and re-added, summing the appropriate field. This can be done relatively quickly. One tip would be to deploy a second Coronavirus Response Solution to reference indicator configurations. If deploying a second time, you might want to un-check the Use Existing Items in The Organization option in the Options hamburger menu. 

Another option would be to use ArcGIS Online Assistant to find the item ID references to the Cases_current view shipped with the Solution in the JSON of the Community Impact Dashboard and replace those references with the item ID of your newly created Cases_current view. However, directly modifying the JSON of any item is risky and should only be done if you are confident and familiar with that sort of workflow. 

Mike

0 Kudos
MikeDagle
Esri Contributor

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:

Cases_public is just a basic view of Cases with editing turned off in Settings (used in the Community Impact Dashboard)

Cases_reporter - as above but with editing turned on (used by the Case Reporter survey)

Cases_current - a join view returning the most recent report for a reporting area. 

A new field can be exposed on the existing Cases_public and Cases_reporter views, whereas Cases_current needs to be recreated. Let's look at exposing first:

In all likelihood a new field will be added to the Cases table which means the method of defining the fields exposed to the view using Visualization tab on the item page will not work. However, we can add the table to a map to set the view definition:

  1. Add a new field to the Cases table in the Cases feature layer.
  2. Navigate to the Cases_public or Cases_reporter view in your contents.
  3. Click the Open in Map View down arrow, then Add to new map.
  4. Click the More Options ellipses on the Cases, then click Set View Definition. Click Define Fields.
  5. Scroll to the newly created field, check the box. Click Apply. The new field is added to the view’s definition.

To get that new field on Cases_current it will need to be recreated:

  1. Add the Cases feature layer to a new web map.
  2. Click Analysis, Summarize Data, Join Features.
  3. Configure the join in this way (Note on naming the new view: to name the new view Cases_current, the existing join view would need to be deleted. However because of subsequent steps, it would be advantageous to leave the current Cases_current view in place and use a new name):
    1. Name:

      Cases_current or something similar. 

      Target:

      Reporting Areas

      Layer to join to the target layer:

      Cases

      Fields to match:

      name = name

      Join Operation:

      Join one to one

      Define which record is kept:

      Order by Date Reported / Sort by Newest

  4. Update the Community Impact Dashboard indicators and selector dropdown to use the new join view. This will require reconfiguring some of the dashboard elements. Because of this, a good workflow is leaving the existing Cases_current view in place, save a copy of the dashboard for configuration reference, update the original dashboard to use the new view. 

Mike