Scheduled offline caching

  • Release version: Xanadu
  • Updated August 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Scheduled offline caching

    Scheduled offline caching enables field technicians using ServiceNow mobile applications to receive automatic, scheduled updates to their offline data cache based on their individual work schedules. This ensures they have up-to-date information available while working offline, enhancing productivity and efficiency.

    Show full answer Show less

    Activation and Setup

    • Activate Agent Schedule plugin: To enable this feature, the com.snc.agentschedule plugin must be activated in your instance.
    • Create work schedules: For Mobile Agent users, schedules are created automatically upon plugin activation. For other mobile clients, entries in the Offline download schedule (syssgofflinedownloadschedule) table must exist to specify the client type and related offline download schedules.
    • Define agent schedules: Use the Agent Work Schedules [agentworkschedule] table to create and manage technician schedules. These records drive background jobs that generate daily schedules in Agent Daily Schedules [agentdailyschedule], triggering silent push notifications for offline payload downloads during scheduled work periods.

    Scheduled Jobs and Events

    • Populate Agents Daily Schedule Table: Runs once daily for users with background downloading enabled, ensuring schedules are up to date.
    • Scheduled Download of Offline Payload: Creates events in the mobileofflinepayloadgenqueue table to initiate offline payload generation and delivery.
    • Event tracking: Offline payload creation and delivery events are logged in the Events [sysevent] table to monitor timing and status.

    System Properties for Configuration

    Several system properties allow customization of scheduled offline caching behavior:

    • glide.sg.offline.scheduleddownload.enabled: Enables or disables scheduled offline downloading for Mobile Agent users.
    • glide.sg.offline.scheduleddownload.cachesyncoffset: Sets how many minutes before a user’s scheduled time the payload generation starts. Important to align this with the Mobile Offline Scheduling job timing to avoid generation issues.
    • glide.sg.offline.scheduleddownload.reminderoffset: Defines when users receive reminders to manually download caches if none exist or the cache has expired.
    • glide.sg.offlinepayload.refreshfrequency: Controls the frequency (in minutes) of payload refresh timestamps, with a default of 480 minutes.
    • glide.sg.offline.attachment.maxtotalbytes: Sets the maximum allowed size for all attachments included in the offline cache, up to 2048 MB.

    These properties provide flexibility to tailor offline caching schedules and payload sizes to match organizational needs and mobile user workflows.

    Configure offline caching so your field technicians can receive scheduled updates to their offline data cache. Scheduled downloads are based on the user's work schedule.

    Activate the Agent Schedule plugin

    To enable and configure scheduled offline caching, the Agent Schedule plugin [com.snc.agent_schedule] must be activated. For details on plugin activation, see Activate a plugin.

    Create work schedules for offline caching

    For mobile clients other than Mobile Agent, ensure that an entry in Offline download schedule (sys_sg_offline_download_schedule) exists for the client type, for example, Request. This entry specifies the table that has the offline download schedules for the agents or technicians. Mobile uses the schedule from this table for scheduling offline cache generation. To populate schedules for each user, a scheduler script can be used like in Field Service Mobile.

    For Mobile Agent, the entry is created when the plugin is activated. After activating the plugin, you must create work schedules for the agents or technicians to enable users to automatically receive scheduled offline caches. This can be done directly through the Agent Work Schedules [agent_work_schedule] table. For more information on how to create schedules through this table, see Create a work schedule for an agent or technician.

    Based on the records from the Agent Work Schedules table, your instance runs background scheduled jobs that create schedules in the Agent Daily Schedules [agent_daily_schedule] table. Within these schedules, agents will receive a silent push sometime throughout their scheduled day.

    The offline payloads that your instance generates are based on the times recorded in the Agent Daily Schedules. These can be found in the Events [sysevent] table. Use the records in the Event table to track these payloads, and info about when they are created and when they are sent to the agents.

    Scheduled Jobs associated with offline caching

    These scheduled jobs are automatically scheduled for only users who enable background downloading on their app. For information on how users can enable this feature, see Offline mode for mobile.

    Populate Agents Daily Schedule Table
    This job runs once daily for all users with background downloading set to true.
    Scheduled Download of Offline Payload
    This job creates an event for the first payload of the day in the [mobile_offline_payload_gen_queue] table.

    Offline scheduling system properties

    Use the following properties on the System Properties [sys_properties] table to configure scheduled offline caching.

    Table 1. Offline scheduling system properties
    Property Description
    glide.sg.offline.scheduled_download.enabled

    Enables scheduled downloading for all Mobile Agent app users.

    glide.sg.offline.scheduled_download.cachesync_offset Determines when your instance starts payload generation prior to schedule. Value determines how many minutes before the user schedule payload generation begins.
    Note:
    Be sure not to set the value of this property earlier than your Mobile Offline Scheduling job is runs. Doing so will prevent offline payloads from being generated.
    glide.sg.offline.scheduled_download.reminder_offset Determines when your instance sends your users a daily reminder to manually download a cache. The instance sends this reminder only when there is no cache or the cache is expired. Value determines how many minutes before a user schedule your instance sends this reminder.
    glide.sg.offline_payload.refresh_frequency Determines refreshTimestamp frequency of payloads. Value represents this frequency in minutes The default value is 480.
    glide.sg.offline.attachment.max_total_bytes Determines the maximum size allocated for all attachments in a cache. Value is represented in Megabytes (MB). The maximum value is 2048 MB.

    For information on more offline related system properties, see, Configure offline mode behavior.