Enabling view configurations in views

Promoted fields and user-defined fields are always available to users who have the appropriate security group. Users can show or hide these fields in grids and reports, or use them to highlight and label floor plans. But these user configuration changes are not be preserved for the next user session if users change computers or clear browser cookies. To have the fields available, you must enable a view to use a view configuration.

View configurations are records in the afm_view_configuration table. Each view configuration has:

  • the configuration ID field ( configuration_id ). Use this to reference the configuration from the view.
  • the content field ( content ), which contains data in JSON format.

A view configuration can include settings for multiple panels:

{ roomsGrid: { fields: [{ name: 'date_last_surveyed' }, { name: 'dt_pressure' }], ... }, employeesGrid: { ... }, floorPlan: { highlights: [{ name: 'reservable' }, { name: 'status' }], labels: [{ name: 'status' }] } }

View configurations can be reused between views, as long as panel IDs match.

A specific view can use only one view configuration. To specify the view configuration, add the configuration attribute to the view tag in the AXVW file:

<view version="2.0" configuration="spaceConsoleConfiguration"> <title>Space Console</title> ... </view>

This is the only change to make. Each grid panel and each drawing panel in the view will automatically save user configuration settings into the corresponding section of the view configuration, and will automatically load and apply these settings when the user loads the view again.

View configurations are global, and not user-specific. If any user modifies a view configuration, the changes will be visible to all users who have access to this view.