Skip to main content

Reporting: Loop through users — run as user

Peronalised scheduled reporting per user

Piers Batchelor avatar
Written by Piers Batchelor
Updated over 2 weeks ago

Summary:

Adds an option to send a scheduled report as each recipient. The run context switches per recipient. Each email is generated using that user’s permissions, variables, and row-level security.

Who it’s for:

Admins and builders who schedule the same report to many users but need user-scoped data without cloning schedules.

What changes in UI:

  • New checkbox under Recipients: Run as each recipient

    • Small (i) opens help.

    • Checkbox is disabled if any recipient email is outside the tenant.

  • Form warning when non-tenant emails are present.

How it works:

  • One schedule fans out into a report execution, for each user.

  • For each recipient user, the job:

    1. Impersonates user

    2. Runs report and actions with Current User context

    3. Sends email to user

  • Actions and expressions can reference Current User (e.g., chart title, filters).

Action example:

Use the action block: Get → Current User → Email
Common uses:

  • Set chart title: concat('Weekly Sales — ', current_user_email())

  • Filter by region from user attribute

  • Pick theme or locale per user

Validation:

  • If the recipient list includes any external email:

    • Show inline error and disable Run as each recipient.

  • If a recipient account is inactive:

    • Skip that user and flag in schedule log.

Limits:

  • Max recipients per fan-out: 500 per schedule run.

  • Total runtime caps match standard schedule limits.

  • Attachments and formats are the same as normal schedules.

Security notes:

  • Uses the same RLS, permissions, and variable values the user has in the workspace.

  • No elevation. If a user cannot view a sheet, the section is omitted or rendered empty per current behavior.

Setup steps:

  1. Open New Schedule.

  2. Add recipients (tenant users only).

  3. Tick Run as each recipient.

  4. Fill Subject and Body.

  5. Add attachments and set Frequencies.

  6. Save.

Did this answer your question?