Save User Filter Configurations with Omni Events messaging

Saving and Restoring Dashboard Filter Configurations with Omni Events Messaging for Embedded Dashboards

This guide explains how to save and restore user filter configurations for embedded dashboards, allowing your users to return to their preferred dashboard views within your embedded application and not need to be restricted_queriers.

Overview

When users interact with embedded dashboards, they often apply filters to customize their view. By capturing these filter changes, you can save their preferences and restore them in future sessions, creating a personalized experience.

Prerequisites

  1. Be an admin user in Omni
  2. Have the ability to embed Omni

Before implementing this feature, you’ll need to:

  1. Enable vanity domains - This eliminates cross-origin restrictions that would block communication between your application and the embedded dashboard. Both your application and the dashboard need proper DNS configuration.

Implementation Steps

Step 1: Set Up Communication

Implement the postMessage protocol in your application to enable two-way communication with the embedded dashboard. This allows your application to:

  • Listen for events from the dashboard
  • Send stored events back to the dashboard

Step 2: Setup your application to listen to events

Capture Filter Changes

Configure your application to listen for filter change events and specifically to listen to dashboard filters listen to dashboard:filters.

When users modify dashboard filters:

  • The dashboard emits an event containing the complete filter state
  • Your application captures this filter configuration payload
  • Store this data in your preferred format (database, local storage, etc.)

Step 3: Save Filter Configurations

When a filter change event occurs:

  • Extract the filter payload from the event
  • Associate it with the current user
  • Persist the configuration in your app’s production database

Step 4: Restore Saved Configurations

To restore a user’s saved filter preferences:

  1. Retrieve the stored filter payload from your database
  2. Send the payload back to the embedded dashboard using postMessage to send an event and more specifically send an event that contains the dashboard:filter-change-by-url-parameter
  3. Then when the user clicks on their stored config the dashboard automatically updates to match the saved configuration.

Benefits of This Approach

This event-based solution offers several advantages:

  • Flexibility - Customize the save/restore experience to match your application’s design
  • Integration - The feature lives within your application’s existing UI patterns
  • User Experience - Provides a seamless, cohesive experience for users working with embedded dashboards
1 Like