Skip to content

Commit

Permalink
fixed macros
Browse files Browse the repository at this point in the history
  • Loading branch information
usmangt committed Jul 16, 2024
1 parent ae27952 commit e4ce43e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/sources/variables-and-macros/macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ weight: 202

# Macros

A macro is a feature that allows you to simplify the syntax and add dynamic parts to your queries. They help make your queries more flexible and adaptable to changing conditions.
A macro is a feature that allows you to simplify the syntax and add dynamic parts to your queries. They help make your queries more flexible and adaptable to changing conditions. It's important to note that while not all data source plugins have macros as it availability and implementation depends on the specific design and capabilities of each plugin.

You can use the following macros in your queries
The GitHub data source plugin do support the macro feature and you can use the following macros in your queries:

| Macro name | Syntax | Description | Example |
| ---------- | -------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| multiVar | `$__multiVar(prefix,$var)` | Expands a multi value variable into github query string | `$__multiVar(label,$labels)` will expand into `label:first-label label:second-label` |
| | | When using **all** in multi variable, use **\*** as custom all value | |
| day | `$__toDay(diff)` | Returns the day according to UTC time, a difference in days can be added | `created:$__toDay(-7)` on 2022-01-17 will expand into `created:2022-01-10` |
| day | `$__toDay(diff)` | Returns the day according to UTC time, a difference in days can be added | `created:$__toDay(-7)` on 2022-01-17 will expand into `created:2022-01-10` |

0 comments on commit e4ce43e

Please sign in to comment.