Reporting: Loop through users — run as user
Summary:
Section titled “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:
Section titled “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:
Section titled “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:
Section titled “How it works:”-
One schedule fans out into a report execution, for each user.
-
For each recipient
user, the job:-
Impersonates
user -
Runs report and actions with
Current Usercontext -
Sends email to
user
-
-
Actions and expressions can reference Current User (e.g., chart title, filters).
Action example:
Section titled “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:
Section titled “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:
Section titled “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:
Section titled “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:
Section titled “Setup steps:”-
Open New Schedule.
-
Add recipients (tenant users only).
-
Tick Run as each recipient.
-
Fill Subject and Body.
-
Add attachments and set Frequencies.
-
Save.