The problem: It can be hard to tell whether someone has finished a class, finished the program, or is still working through it.

What this does: One report page lets a ministry leader pick a program and a class, then see each student with a Completed yes/no. Leaders can filter to just the students who haven't finished, then use the grid actions to message them, export the list or launch a workflow. (Screenshot 1)

What you'll build

One page with two blocks:

  1. A Page Parameter Filter block with three filters: Completed, Program and Class.
  2. A Dynamic Data block that runs a SQL query using the filter choices.

The filters pass their choices to the query as page parameters. The filter Key must exactly match the parameter name the query reads: Program, Class and Completed.

Step 1: Add the Page Parameter Filter block

Add the block to your page and open its settings (screenshot 2). We used Selection Action: Update Block, so choosing a program refreshes the Class list without leaving the page. We showed three filters per row, with both the Filter and Reset Filters buttons.

Add these three filters:

Name / KeyField typeValues
CompletedMulti-Select1^Yes, 2^No (screenshot 3)
ProgramSingle-Select, Drop Down ListLava, shown below (screenshot 4)
ClassSingle-Select, Drop Down ListLava, shown below (screenshot 5)

Program filter values list the active programs. The value sent to the query is the program’s GUID, and the label shown is its name:

{% learningprogram where:'IsActive == true' securityenabled:'false' %}{% endlearningprogram %}{% for program in learningprogramItems %}{{ program.Guid }}^{{ program.Name}}{% if forloop.last == false %},{% endif %}{% endfor %}

Class filter values list the classes in the selected program. It stays empty until a program is chosen:

{% assign program = 'Global' | PageParameter:'Program' %}
//- Only accept a real GUID, because this value is placed inside the entity command expression below.
{% assign isProgramGuid = program | RegExMatch:'^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$' %}
{% if isProgramGuid %}
{% learningclass where:'IsActive == true && IsArchived == false' expression:'LearningCourse.LearningProgram.Guid == "{{ program }}"' securityenabled:'false' %}{% endlearningclass %}{% for class in learningclassItems %}{{ class.Guid }}^{{ class.Name}}{% if forloop.last == false %},{% endif %}{% endfor %}
{% endif %}

Step 2: Add the Dynamic Data block

Add a Dynamic Data block to the same page and paste the query below into Query (screenshot 6). Our settings:

  • Query is a Stored Procedure: off. Timeout: 30 seconds.
  • Person Report: on. This enables the Communicate, Merge Person, Bulk Update, Launch Workflow and Excel Export actions.
  • Hide Columns: Id. Person Report uses the Id column to know who each row is, so keep it in the query and hide it from view.
  • Show Grid Filter and Wrap in Panel: on.
{% assign classGuid = 'Global' | PageParameter:'Class' | SanitizeSql %}
{% assign completed = 'Global' | PageParameter:'Completed' | SanitizeSql %}

//- Looks up the built-in LMS "Student" role by its system GUID so this works on any Rock server.
DECLARE @StudentGroupMemberRoleId INT = (
    SELECT [Id]
    FROM [GroupTypeRole]
    WHERE [Guid] = 'FA3ACAC2-0377-484C-B888-974CA3BF2FF2'
)

{% if classGuid and classGuid != empty %}
    SELECT
        p.[Id] AS [Id]
        , CONCAT( p.[NickName], ' ', p.[LastName] ) AS [Name]
        , p.[Email] AS [Email]
        , CAST( CASE WHEN lp.[LearningCompletionStatus] = 2 THEN 1 ELSE 0 END AS bit ) AS [Completed]
    FROM [GroupMember] gm
        INNER JOIN [LearningParticipant] lp ON lp.[Id] = gm.[Id]
        INNER JOIN [Person] p ON p.[Id] = gm.[PersonId]
        INNER JOIN [Group] g ON g.[Id] = gm.[GroupId]
    WHERE g.[Guid] = '{{ classGuid }}'
        {% if completed and completed != empty and completed != '1,2' %}
            {% if completed == '1' %}
                AND lp.[LearningCompletionStatus] = 2
            {% elseif completed == '2' %}
                AND ISNULL( lp.[LearningCompletionStatus], 0 ) <> 2
            {% endif %}
        {% endif %}
        AND gm.[GroupRoleId] = @StudentGroupMemberRoleId
    ORDER BY
        p.[NickName]
        , p.[LastName]
{% endif %}

Good to know

  • “Completed” means passed. The query counts a student as completed only when their completion status is Pass. Yes shows students who passed. No shows everyone else, including students still in progress and students who failed.
  • Students only. Facilitators and other roles are left out. The query finds the Student role using Rock’s built-in LMS Student GUID, so you don’t need to look up any IDs.
  • Restrict the page. The report shows names and email addresses, and the filter lists ignore security, so limit the page to your LMS administrators.
  • Nothing shows until a class is chosen. That is expected.