Skip to content

Tgt - Notifying when a store hits its monthly target

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.


Two complementary Zaps:

  • Main Zap — triggers every weekday morning, detects stores that have reached their monthly target since the previous day, and sends a Slack notification. A memory system ensures a store only receives the alert once per month.
  • Reset Zap — runs on the 1st of each month to clear the memory and reset the system.

Main Zap

Schedule → Date calculation → Store query → Loop (Storage check → Filter → Slack → Storage write)

Reset Zap

Schedule → Storage cleanup

Configure a Schedule by Zapier block:

  • Frequency: Every Week
  • Days: Monday, Tuesday, Wednesday, Thursday, Friday
  • Time: 9:00 AM

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):
- Yesterday
- Start of month
- End of month
Output: return an "output" dictionary with all dates in YYYY-MM-DD format.

Create a per-store chart in Biron retrieving the current month’s revenue and the monthly target. Copy the generated NexusQL, paste it into the Biron Query block in Zapier, then replace the static dates with the variables produced in the previous step.

Add the following condition to the query to automatically filter and return only stores that have exceeded their target (adapt metric names to match your query):

WHERE
`CA HT Mois En Cours` >= `Objectif CA HT`

Add a Looping by Zapier block, passing it only the store names from the previous query.

The loop iterates over each store that has exceeded its target and executes the following four steps for each of them.


For each store, retrieve the value shop_reached_target_[Store Name] from Zapier Storage.

If this key exists, the store has already been notified this month. If it is absent, the store has just reached its target.


Add a Filter block with the following condition:

  • Continue only if shop_reached_target_[Store Name] does not exist in storage

Already-notified stores are stopped here. New ones proceed to the next step.


Add a Slack block and configure:

  • Channel: the channel where the celebration should be sent
  • Message Text: a message indicating that the store has reached its monthly target, with the revenue and target variables from the Biron query

Once the message is sent, write the key shop_reached_target_[Store Name] into Zapier Storage to block subsequent notifications until the monthly reset.


This Zap clears all memory keys each month to allow the main Zap to start fresh.

Configure a Schedule by Zapier block:

  • Frequency: Every Month
  • Day: 1
  • Time: 2:00 AM

Add a Code by Zapier block (Python). Use the following prompt to generate the code, then paste the result into the block:

I want to clean up data stored in Zapier Storage.
I have entries whose name starts with shop_reached_target_ and I want
to delete all of them automatically.
Write me the Python code for a "Code by Zapier" step that:
1. Connects to Zapier Storage using a secret key that I will add
to the code
2. Retrieves all stored entries
3. Deletes only those whose name starts with shop_reached_target_

As soon as a store crosses its monthly target, your team receives a Slack notification — once per month, regardless of how often the Zap runs. On the 1st of each month, the memory is cleared and the cycle starts again.