Hi all! Since the documentation does not open, can...
# ask-questions
p
Hi all! Since the documentation does not open, can anyone tell me a list of meta variables? I mean something like this - {{ experimentId }}, {{ experiment_start_date }},
w
Yes. Sorry that it is currently down. Here is our documentation on that matter: SQL Templates We use {{Handlebars}} to compile the assignment sql, identity queries, etc. into what is actually called to your database. You can use any of the in-built variables that Growthbook automatically sets: • startDate -
yyyy-MM-dd HH:mm:ss
of the earliest data that needs to be included • startDateISO -
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
of the startDate in ISO format. This can then be used with the
date
helper to achieve whatever format you like (ex.
{{date startDateISO "yyyyMMdd"}}
) • endDate -
yyyy-MM-dd HH:mm:ss
of the latest data that needs to be included • endDateISO -
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
of the endDate in ISO format. This can then be used with the
date
helper to achieve whatever format you like (ex.
{{date endDateISO "yyyyMMdd"}}
) • experimentId - Either a specific experiment id OR
%
if you should include all experiments You can also use any of the in-built helper functions: • camelcase [str] - ex.
{{camelcase "My database"}}
compiles to
myDatabase
. • dotcase [str] - ex.
{{dotcase "My database"}}
compiles to
my.database
. • kebabcase [str] - ex.
{{kebabcase "My database"}}
compiles to
my-database
. • lowercase [str] - ex.
{{lowercase "My database"}}
compiles to
my database
. • pascalcase [str] - ex.
{{pascalcase "My database"}}
compiles to
MyDatabase
. • replace [str] [pattern] [replacement] - Replace all occurences of a regular expression with something else. ex.
{{replace "My%%%Database!" "\[^a-zA-Z\]" ""}}
compiles to
MyDatabase
• snakecase [str] - ex.
{{pascalcase "My database"}}
compiles to
my_database
. • uppercase [str] - ex.
{{uppercase "My database"}}
compiles to
MY DATABASE
. • date [date] [format] - Format an ISO date according to this format, being careful not to mix up months (MM) and minutes (mm). ex.
{{date startDateISO "yyyyMMdd"}}
might compile to
20230130
. The most common codes are: • codemeaningyyyyyearMMmonthdddayHHhourmmminutessssecondsttimestamp
p
Thanks a lot!!!
w
Sure thing. Sorry again that the docs were down. They are back up now.