Core Docs - Supporting Rock - Set Up Persisted Datasets

Rock Version: v19.0
Last Modified: 2026-02-17 3:15 PM

Let's see how to actually set up your first Persisted Dataset. In your Rock instance, go to Admin Tools > CMS Configuration > Persisted Datasets and create a new dataset. You’ll see the screen pictured below.

Building Persisted Dataset Lava

The Persisted Dataset Build Script is Lava that has been specifically formatted to output as JSON. You’ll need to format your Build Script to create properly formatted JSON that Rock can then deserialize. So, when you’re creating a Build Script using Lava, keep a few things in mind:

Example Build Script
[
{%- assign slots = '140' | FromCache:'DefinedType' -%}
    {%- for item in slots.DefinedValues -%}
        {
            "Id": {{ item.Id | ToJSON }},
            "Slot": {{ item.Value | ToJSON }},
            "SlotDay": {{ item | Attribute:'Day' | ToJSON }},
            "SlotTime": {{ item | Attribute:'Time' | ToJSON }},
            "SlotDateTime": {{ item | Attribute:'DateTime' | ToJSON }},
            "SlotIsSchedulable": {{ item | Attribute:'IsSchedulable' | ToJSON }},
            "SlotLength": {{ item | Attribute:'Length' | ToJSON }},
            "SlotDateTime": {{ item | Attribute:'DateTime' | ToJSON }}
        }{%- unless forloop.last -%},{%- endunless -%}
    {%- endfor -%}
]
                

Now that you know a little bit more about how Persisted Datasets work, let’s take a look at a specific example. A good use case is displaying the output of timeslots for a conference. From the example pictured below, there are a few details we want to point out.

Given the example Build Script pictured above, you could use the Lava shown below to output to your page:

{%- assign slots = 'conferenceslots' | PersistedDataset -%}
    {%- for item in slots -%}
  • {{ item.Slot }} ({{ item.SlotTime }} minutes) - {{ item.SlotDateTime }}
  • {%- endfor -%}