2013-08-29 16:49:15 +00:00
created: 201308291647
modified: 201308291647
2014-09-11 14:52:47 +00:00
tags: Concepts
2013-08-29 16:49:15 +00:00
title: DataTiddlers
2014-12-28 09:51:53 +00:00
A data tiddler is a miniature database contained within a tiddler.
2013-08-29 16:49:15 +00:00
2014-12-28 09:51:53 +00:00
There are two standard formats:
2013-08-29 16:49:15 +00:00
2014-12-28 09:51:53 +00:00
* DictionaryTiddlers
* [[JSONTiddlers]]
2013-08-29 16:49:15 +00:00
2014-12-28 09:51:53 +00:00
Other formats of tiddler can also be parsed to yield blocks of data that behave like data tiddlers.
2013-08-29 16:49:15 +00:00
2016-06-09 21:09:16 +00:00
Use a TextReference to look up the value of a named property. For example, if a [[DictionaryTiddler|DictionaryTiddlers]] called `MonthDays` contains:
2013-08-29 16:49:15 +00:00
```
2014-12-28 09:51:53 +00:00
oct:31
nov:30
dec:31
2013-08-29 16:49:15 +00:00
```
2014-12-28 09:51:53 +00:00
... then `{{MonthDays##nov}}` will resolve to the value `30`.
The same is true if `MonthDays` is a [[JSONTiddler|JSONTiddlers]] with the following content:
2013-08-29 16:49:15 +00:00
```
2014-12-28 09:51:53 +00:00
{"oct":31,"nov":30,"dec":31}
2013-08-29 16:49:15 +00:00
```
2014-12-28 09:51:53 +00:00
Note: //It is currently only possible to retrieve data from the immediate properties of the root object of a JSONTiddler.//
2016-06-09 21:09:16 +00:00
The widgets ActionSetFieldWidget and ActionListopsWidget can manipulate named properties of data tiddlers by indicating the name of the property in the $index attribute. To create or modify a named property with ActionSetFieldWidget, provide a $value attribute. To delete a named property with ActionSetFieldWidget, omit the $value attribute. ActionListopsWidget assigns the named property the list constructed through its $filter and $subfilter attributes.