-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjinja.quickbase
More file actions
126 lines (94 loc) · 3.4 KB
/
jinja.quickbase
File metadata and controls
126 lines (94 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// basic if statement
{% if [condition_1] %}
[result if true]
{% elif [condition_2] %} // optional
[result if true]
{% else %} // optional
[otherwise result]
{% endif %}
// check if not null
{% if a.field_name}
{% endif %}
// check against a value
{% if a.field_name == "value"}
{% endif %}
// basic loop
{% for item in list %}
[do something]
{% endfor %}
// Hardcoded reference to the first index of a search record step (b)
{{b[0].field_name}}
// loop over a dictionary
{% for key, value in dictionary.items() %}
{{ key }}: {{ value }}
{% endfor %}
// In-line conditional with a for loop
{%- for item in list if [condition_1] and [condition_2] -%}
// Comments
{# this is a comment #}
// Variable types
// Boolean - represents the values true and false
// Integer - Integers are whole numbers without a decimal part.
// Floating point - numbers can be written using a ‘.’ as a decimal mark
// Sequence [‘a’] everything between the two brackets is a list.
// String -a sequence of characters, either as a literal constant or as some kind of variable
// Tuple - can contain two values of different data types
// Mappings - {'dict': 'of', 'key': 'and', 'value': 'pairs'}
// Variable declaration
{% set iterated = false %}
// Previous field value
{{a.$prev.status}} // field called status
// Note that this is NOT usable in a trigger step (e.g. in an advance filter query). Can only be used in later steps.
// Clear/remove a value
{{CLEAR}}
// Clear/remove a value if the writing value is null
{{CLEAR if a.status is none else a.status}}
// Check if a field is blank/null
{% if a.field_label is none %}TRUE{% endif %}
// Add two values together
{{a.value_1 + a.value_2}}
// Convert text to an integer or a floating-point number
{{a.value|int }} {{a.value|float}}
// Change case
{{a.field|upper}} {{a.field|lower}}
// Append a value
{{a.name|append('new_name')}}
// Remove all HTML tags and formatting
{{a.body|text}}
// Convert to markdown
{{a.body|html2text}}
// Convert to HTML-safe sequence
{{a.value|escape}}
// Count the number of items found in a search/query
{{a|count}}
// Current date. Prefer this to {{ time.today }} which doesn't account for time zone
{{time.now}}
// Adjust time
{{time.now + time.delta(hours=1)}} // days / months / years
// # of days between two dates
{{(a.date_1 - a.date_2).days}}
// Time zones:
{{time.now|timezone('America/New_York')}} // Eastern
{{time.now|timezone('America/Chicago')}} // Central
{{time.now|timezone('America/Denver')}} // Mountain
{{time.now|timezone('America/Los_Angeles')}} // Pacific
// format a time
{{time.now|date_ymd}} // 2025-12-31
{{time.now|date_dmy('/')}} // 31/12/2025
{{time.now|date_mdy('.')}} // 12.31.2025
{{time.now.strftime('%Y%m')}} // 202512
// Parse a date time value from a Quickbase step into a format that the restful API can consume.
{{a.created_at.strftime('%Y-%m-%dT%H:%M:%S')}}
// List of fields of a record as key/value pairs (e.g. for looping through)
{{metadata.a.struct.items()}}
// Current loop index (first loop is 1)
{{metadata.a.loop.index}}
// Pipeline data
{{runtime.pipeline_id}} // id
{{runtime.pipeline_name}} // name
{{runtime.pipeline_url}} // url
{{runtime.activity_url}} // run activities url
{{runtime.triggered_at}} // trigger timestamp
// rich text run stamp
"Updated by pipeline#<a href='{{runtime.pipeline_url}}''>{{runtime.pipeline_id}}</a>. View pipeline activity <a href='{{runtime.activity_url}}'>here</a>"
// comment