Skip to content

Commit 8258f38

Browse files
committed
docs: Demo access to nested and object properties (#3580)
1 parent 2c95b59 commit 8258f38

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

docs/Getting Started/Obsidian Properties.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ tags:
213213
- tag-from-file-properties
214214
creation date: 2024-05-25T15:17:00
215215
project: Secret Project
216+
nested_data:
217+
surname: "Doe"
218+
firstname: "Jane"
219+
middle name: "Frances"
220+
object_serialization: {"nested1": "value1", "nested2": "value2"}
216221
---
217222
```
218223
<!-- endSnippet -->
@@ -235,6 +240,11 @@ The following table shows how most of those properties are interpreted in Tasks
235240
| `task.file.property('sample_link_property')` | `string` | `'[[yaml_all_property_types_populated]]'` |
236241
| `task.file.property('sample_link_list_property')` | `string[]` | `['[[yaml_all_property_types_populated]]', '[[yaml_all_property_types_empty]]']` |
237242
| `task.file.property('tags')` | `string[]` | `['#tag-from-file-properties']` |
243+
| `task.file.property('nested_data').surname` | `string` | `'Doe'` |
244+
| `task.file.property('nested_data').firstname` | `string` | `'Jane'` |
245+
| `task.file.property('nested_data')['middle name']` | `string` | `'Frances'` |
246+
| `task.file.property('object_serialization').nested1` | `string` | `'value1'` |
247+
| `task.file.property('object_serialization').nested2` | `string` | `'value2'` |
238248

239249
<!-- placeholder to force blank line after included text --><!-- endInclude -->
240250

docs/Scripting/Task Properties.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ These are described in full in [[Obsidian Properties]].
229229
| `task.file.property('sample_link_property')` | `string` | `'[[yaml_all_property_types_populated]]'` |
230230
| `task.file.property('sample_link_list_property')` | `string[]` | `['[[yaml_all_property_types_populated]]', '[[yaml_all_property_types_empty]]']` |
231231
| `task.file.property('tags')` | `string[]` | `['#tag-from-file-properties']` |
232+
| `task.file.property('nested_data').surname` | `string` | `'Doe'` |
233+
| `task.file.property('nested_data').firstname` | `string` | `'Jane'` |
234+
| `task.file.property('nested_data')['middle name']` | `string` | `'Frances'` |
235+
| `task.file.property('object_serialization').nested1` | `string` | `'value1'` |
236+
| `task.file.property('object_serialization').nested2` | `string` | `'value2'` |
232237

233238
<!-- placeholder to force blank line after included text --><!-- endInclude -->
234239

0 commit comments

Comments
 (0)