What are Variables?
Variables are named placeholders that carry data from one step to the next. When a Pull Stats step fetches your affiliate stats, each cell of data is stored as a variable — for example,{affiliate_name_1_stats_1} or {revenue_2_stats_1}. You then insert those variables into your email body, invoice template, or condition check, and AffZero replaces them with real values when the automation runs.
Variable Naming Convention
Variables follow a consistent pattern depending on which step produced them:Pull Stats Variables
column_name— the data column (e.g.affiliate_name,revenue,payout,clicks,conversions)row_index— which row of the results (1-based: first row = 1, second row = 2, etc.)N— which Pull Stats step in the automation (first Pull Stats step = 1, second = 2, etc.)
| Variable | What it contains |
|---|---|
{affiliate_name_1_stats_1} | Name of the affiliate in row 1 from the first Pull Stats step |
{revenue_1_stats_1} | Revenue for row 1, first Pull Stats step |
{payout_2_stats_1} | Payout for row 2, first Pull Stats step |
{affiliate_name_1_stats_2} | Affiliate name from row 1 of the second Pull Stats step |
AI Analyze Variables
The AI Analyze step produces custom named variables based on your instruction. For example, if you tell the AI to “find the top affiliate by revenue”, it might produce:{top_affiliate}— the name{top_affiliate_revenue}— the revenue value
Generate Invoice Number Variable
invoice_number).
Tracker Action Get Variables
field_path is the API response field you selected, and N is the step index.
How to Select Variables (in Pull Stats)
Variables from Pull Stats are only created for the cells you explicitly select in the test pull:- Run a test pull in the Pull Stats step to fetch a data preview
- Click on individual cells in the table to select them
- Selected cells are highlighted — they’re now registered as variables
- You can see all registered variables in the Variables Available panel
Only selected cells become variables. If you don’t click a cell, that data won’t be available downstream — even if it appears in the test pull table.
Entity Matching — Why Row 1 Stays Row 1
When the automation runs for real (not a test pull), the stats data may come back in a different order depending on how the tracker API returns results on that day. AffZero handles this by tracking the entity ID (e.g. the affiliate’s internal ID) instead of just the row position. When AffZero fetches fresh data during a run:- It looks up the entity ID you selected (e.g. Affiliate ID 123)
- Finds that entity in the fresh results — regardless of which row it’s in
- Extracts the variable values from that matched row
{affiliate_name_1_stats_1} always refers to the same affiliate, not just whoever happens to be in row 1 on that particular day.
How to Insert Variables
Variables can be used in:- Email subject line — type
{to start or use the Variables panel to copy and paste - Email body — click the variable name in the Variables Available panel to insert it at the cursor position
- Invoice HTML template — type the variable name directly in the HTML
- Invoice filename — include variables like
{affiliate_name_1_stats_1}in the filename field - Condition Check — reference variables in condition rules (e.g.
{revenue_1_stats_1}is greater than5000) - Google Sheets — map variable values to specific columns
Variables Available Panel
Every step that consumes variables (Send Email, Condition Check, Create Invoice, etc.) shows a Variables Available panel on the left side of the step editor. This panel lists every variable from all previous data-producing steps.- Click a variable name to copy it
- Use the Insert button to place it at the current cursor position in the editor
- Variables from multiple Pull Stats steps are grouped by step for clarity

