Question

Photo of Joey Mouton

0

No campus attribute in workflow Action 'Group Attendance Add'

The workflow Group action 'Group Attendance Add' does not have a campus attribute. It seems like an oversight that it isn't in the action. Anyone have a possible work around?

  • Photo of Michael Garrison

    0

    Joey,

    Since that action stores attendance in the group, leaving campus null, you can add a "SQL Run" action directly following your Group Attendance Add action to go back and add your selected campus to the record.

    Assuming you have attributes like the following:

    You can use a query like the following to set the campus on the attendance record you just created:

    UPDATE
        [Attendance]
    SET
        [CampusId] = '{{ Workflow | Attribute:'Campus','Object' | Property:'Id' }}'
    WHERE
        [Id] = (
            SELECT
                TOP 1 [Id]
            FROM
                [Attendance]
            WHERE
                [CampusId] IS NULL
                AND [GroupId] = '{{ Workflow | Attribute:'Group','Object' | Property:'Id' }}'
                AND [PersonAliasId] = '{{ Workflow | Attribute:'Person','Object' | Property:'PrimaryAlias.Id' }}'
            ORDER BY
                [Id] DESC
        )

    This will update the most recent attendance record which matches the person and group you specify. If you're also setting location, datetime or schedule, we can include those as well for even more assurance that you are updating the correct record.

    Your two actions together might look something like this in your workflow:




    • Joey Mouton

      thank you Michael, I am setting location and schedule so I will include in the where statement too. Thanks again.