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
c1df8e4
commit 570377a
Showing
4 changed files
with
48 additions
and
0 deletions.
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,26 @@ | ||
# TIP: How to put a long list of values in a select without having to type them one by one | ||
|
||
When you already have a long list of values that you want in a select input, instead of putting them one by one in the fixed list, you can use the `dataview` input type and just return the values as an array in the dataview query. | ||
|
||
For example, you can put the following in a select input with `dataview` as the source: | ||
|
||
```ts | ||
return [ | ||
'Wash the dishes', | ||
'Take out the trash', | ||
'Do the laundry', | ||
'Mow the lawn', | ||
'Feed the cat', | ||
'Feed the dog', | ||
'Feed the fish', | ||
'Feed the birds', | ||
'Feed the turtles', | ||
'Feed the rabbits', | ||
'Feed the turtles',] | ||
``` | ||
|
||
And the result will be: | ||
![demo modal](long-list-tip.png) | ||
|
||
Here is an screenshot of how it looks in the form builder: | ||
![demo modal](./media/long-list-builder.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.