generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15fe555
commit f8a2b29
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Managing Results | ||
|
||
The `FormResult` class provides methods for managing form results. | ||
|
||
## `asFrontmatterString(options?: unknown): string` | ||
|
||
Transforms the current data into a frontmatter string, which is expected to be enclosed in `---` when used in a markdown file. This method does not add the enclosing `---` to the string, so you can put it anywhere inside the frontmatter. | ||
|
||
### Parameters | ||
|
||
- `options` (optional): An options object describing what options to pick or omit. | ||
|
||
- `pick` (optional): An array of key names to pick from the data. | ||
- `omit` (optional): An array of key names to omit from the data. | ||
|
||
### Returns | ||
|
||
- `string`: The data formatted as a frontmatter string. | ||
|
||
### Example | ||
|
||
```typescript | ||
const result = await form.openForm('my-form') | ||
tR += result.asFrontmatterString({ pick: ['title'] }); | ||
``` | ||
|
||
## `asDataviewProperties(options?: unknown): string` | ||
|
||
Returns the current data as a block of dataview properties. | ||
|
||
### Parameters | ||
|
||
- `options` (optional): An options object describing what options to pick or omit. | ||
|
||
- `pick` (optional): An array of key names to pick from the data. | ||
- `omit` (optional): An array of key names to omit from the data. | ||
|
||
### Returns | ||
|
||
- `string`: The data formatted as a block of dataview properties. | ||
|
||
### Example | ||
|
||
```typescript | ||
const result = await form.openForm('my-form') | ||
tR += result.asDataviewProperties({ pick: ['title'] });` |