Sending a weekly performance digest
This use case illustrates a concrete use of the Biron plugin in Zapier. If you are not yet familiar with how it works (authentication, query structure, variable management), please read the Biron × Zapier guide first before continuing.
What we’re building
Section titled “What we’re building”A Zap that triggers every Monday morning and automatically sends an email to your board with:
- Global performance: Revenue excl. VAT for the week, month, and current year, with Y-1 comparisons
- Per-store table: orders, revenue, margin, and target achievement for the past week
Zap architecture
Section titled “Zap architecture”Schedule → Date calculation → Global query → Store query → Formatting → GmailTrigger — Schedule by Zapier
Section titled “Trigger — Schedule by Zapier”Configure a Schedule by Zapier block:
- Frequency: Every Week
- Day of week: Monday
- Time: 10:00 AM
Date calculation
Section titled “Date calculation”Biron queries require explicit dates. This block generates them dynamically on each run.
Add a Code by Zapier block (Python). Use the following prompt to generate the code, then paste the result into the block:
Role: Python expert for Zapier.Goal: Create a relative date calculation script.
Calculate the following dates, handling calendar edge cases(leap years, end of month):- Start and end of previous week- Yesterday- Start of current month- Start of current year- Y-1 equivalents of each of the above dates
Output: return an "output" dictionary with all dates in YYYY-MM-DD format.The variables produced will be referenced in the following steps.
Global query — aggregated data
Section titled “Global query — aggregated data”Create your chart in Biron with the global metrics you need, then copy the generated NexusQL.
In the Biron Query block in Zapier, paste the query and replace each static date with the variables produced in the previous step.
The retrieved data covers:
| Metric | Period |
|---|---|
| Revenue excl. VAT | W-1, MTD, YTD |
| Revenue excl. VAT vs Y-1 | W-1, MTD, YTD |
| Number of invoiced orders | W-1 |
| % revenue target achievement | W-1 |
Store query — per point of sale data
Section titled “Store query — per point of sale data”Same principle: create your Biron chart with the store dimensions, copy the NexusQL, and replace the dates.
The retrieved data covers:
| Dimension / Metric | Period |
|---|---|
| Store | — |
| Number of invoiced orders | W-1 |
| Revenue excl. VAT | W-1 |
| Total Margin excl. VAT | W-1 |
| % revenue target achievement | W-1 |
Formatting
Section titled “Formatting”Biron data cannot be injected directly into an email — it must be converted to HTML.
Add a Code by Zapier block (Python) and use this prompt to generate the formatting code as well as the email body:
Role: Python expert for Zapier.Goal: Format data for a weekly email to a board.
Available inputs:Global data:- Revenue excl. VAT (W-1), Revenue excl. VAT (MTD), Revenue excl. VAT (YTD)- Revenue excl. VAT (W-1) vs Y-1, Revenue excl. VAT (MTD) vs Y-1, Revenue excl. VAT (YTD) vs Y-1- Number of invoiced orders (W-1)- % revenue target excl. VAT (W-1)
Store table:- Store, Number of invoiced orders (W-1), Revenue excl. VAT (W-1), Total Margin excl. VAT (W-1), % revenue target excl. VAT (W-1)
Request:1. Write a simple email body for a board, with two placeholder tags: one for the global data block, one for the store table.2. Generate the Python code that produces the corresponding HTML blocks from the inputs, ready to be inserted into the email body.Copy the Python code into the Code block, and the email body into the Gmail block (next step).
Send — Gmail
Section titled “Send — Gmail”Add a Gmail block and configure:
- To: the board recipients
- Subject: e.g.
Weekly reporting — week of {{date_debut_semaine}} - Body: paste the email body generated in the previous step, then insert the HTML variables produced by the formatting block at the designated locations
Test the Zap and verify the email rendering before activating.
Expected result
Section titled “Expected result”Every Monday at 10 AM, your board receives a structured email with the previous week’s performance — with no manual action required on your part.