From eb460ff67e0af73b36f9629ba5fde2cce4ff9b78 Mon Sep 17 00:00:00 2001 From: hborawski Date: Thu, 7 Mar 2024 14:19:20 -0800 Subject: [PATCH 1/3] add syntax examples for default expressions --- docs/site/pages/content/data-expressions.mdx | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/site/pages/content/data-expressions.mdx b/docs/site/pages/content/data-expressions.mdx index 2f277e68d..b27a945eb 100644 --- a/docs/site/pages/content/data-expressions.mdx +++ b/docs/site/pages/content/data-expressions.mdx @@ -180,3 +180,34 @@ There are a few expressions built into Player. These are pretty basic, so if you | `getDataval` | Fetches a value from the model. This is equivalent to using the `{{foo.bar}}` syntax. | `binding` | | `setDataVal` | Sets a value from the model. This is equivalent to using `{{foo.bar}} = 'value'` | `binding`, `value` | | `deleteDataVal` | Clears a value from the model. | `binding` | +| `conditional` | Execute expressions, or return data based on an expression condition | `condition`, `valueIfTrue`, `valueIfFalse` | + +### Examples + +#### `getDataval` +```json +{ + "value": "Hello @[getDataval('user.name')]@" +} +``` + +#### `setDataVal` +```json +{ + "exp": "setDataVal('user.name', 'Test User')" +} +``` + +#### `deleteDataVal` +```json +{ + "exp": "deleteDataVal('user.name')" +} +``` + +#### `conditional` +```json +{ + "value": "It is @[ conditional({{foo.bar}} == 'DAY', 'daytime', 'nighttime') ]@." +} +``` \ No newline at end of file From 02ad8a186ecc51435e766152dd58d2cebc1edc5c Mon Sep 17 00:00:00 2001 From: hborawski Date: Thu, 7 Mar 2024 14:26:15 -0800 Subject: [PATCH 2/3] fix getDataVal casing --- docs/site/pages/content/data-expressions.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/site/pages/content/data-expressions.mdx b/docs/site/pages/content/data-expressions.mdx index b27a945eb..4c7d23715 100644 --- a/docs/site/pages/content/data-expressions.mdx +++ b/docs/site/pages/content/data-expressions.mdx @@ -177,7 +177,7 @@ There are a few expressions built into Player. These are pretty basic, so if you | name | description | arguments | | --------------- | ------------------------------------------------------------------------------------- | ------------------ | -| `getDataval` | Fetches a value from the model. This is equivalent to using the `{{foo.bar}}` syntax. | `binding` | +| `getDataVal` | Fetches a value from the model. This is equivalent to using the `{{foo.bar}}` syntax. | `binding` | | `setDataVal` | Sets a value from the model. This is equivalent to using `{{foo.bar}} = 'value'` | `binding`, `value` | | `deleteDataVal` | Clears a value from the model. | `binding` | | `conditional` | Execute expressions, or return data based on an expression condition | `condition`, `valueIfTrue`, `valueIfFalse` | @@ -187,7 +187,7 @@ There are a few expressions built into Player. These are pretty basic, so if you #### `getDataval` ```json { - "value": "Hello @[getDataval('user.name')]@" + "value": "Hello @[getDataVal('user.name')]@" } ``` From 3a4bf66c3f9bdd6409ed19faa9cbfaa510bb59db Mon Sep 17 00:00:00 2001 From: hborawski Date: Thu, 7 Mar 2024 14:27:31 -0800 Subject: [PATCH 3/3] fix getDataVal casing --- docs/site/pages/content/data-expressions.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/site/pages/content/data-expressions.mdx b/docs/site/pages/content/data-expressions.mdx index 4c7d23715..988d9fabd 100644 --- a/docs/site/pages/content/data-expressions.mdx +++ b/docs/site/pages/content/data-expressions.mdx @@ -184,7 +184,7 @@ There are a few expressions built into Player. These are pretty basic, so if you ### Examples -#### `getDataval` +#### `getDataVal` ```json { "value": "Hello @[getDataVal('user.name')]@"