Skip to content

Commit 304a735

Browse files
committed
Publish v1.4.0
1 parent c02a2cc commit 304a735

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ Operator | Description
151151
--- | ---
152152
`ASUM(a, b)` | Aggregated sum of O2M field. For example: calculate shopping cart total price with `ASUM(products, MULTIPLY(price, quantity))` where `products` is the O2M field in the shopping cart and `price` & `quantity` are 2 fields of `products`.
153153

154+
### Condition
155+
156+
Operator | Description
157+
--- | ---
158+
`IF(A, B, C)` | return `B` if `A` is `true`, otherwise `C`
159+
160+
## Dynamic Variables
161+
162+
There are 2 dynamic variables available that you can use in the expressions:
163+
- `$NOW`: return the current Date object. Example: `{{ YEAR($NOW) }}` returns the current year.
164+
- `$CURRENT_USER`: return the current user's id. Example: `{{ EQUAL($CURRENT_USER, user) }}` checks if the `user` field is the current user.
165+
154166

155167
# Limitation
156168
- Cannot parse literal strings (`{{ 's' }}`).

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "directus-extension-computed-interface",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "Perform computed value based on other fields",
55
"author": {
66
"email": "duydvu98@gmail.com",

0 commit comments

Comments
 (0)