On Sunday, June 21, 2020 at 3:27:20 PM UTC-7, Robert Jopling wrote:
>
> I am a newbie to TW5 and JSON so please can you explain how I achieve 
> that. The JSON file was an export from a database app.
>

To *export* tiddlers from TiddlyWiki using JSON format (go to 
$:/AdvancedSearch -> Filters tab, and enter a list of tiddlers, then press 
the "export" button and choose JSON format)

The result is a file with contents like this:
[
   {
     "created":"20200621234617853",
      "text":"",
      "tags":"",
      "title":"TiddlerOne",
      "modified":"20200621234625900"
   },
   {
      "created":"20200621234629958",
      "text":"",
      "tags":"",
      "title":"TiddlerTwo",
      "modified":"20200621234637103"
   },
   {
      "created":"20200621234639688",
      "text":"",
      "tags":"",
      "title":"Tiddler Three with spaces",
      "modified":"20200621234652570"
   }
]

You can then take that file and drag-and-drop it into another TiddlyWiki 
and you will be prompted to import all three tiddlers.

Note that you don't actually need *all* those fields in the JSON file.  You 
can actually get away with this minimal JSON:
[
   {
      "title":"TiddlerOne"
   },
   {
      "title":"TiddlerTwo"
   },
   {
      "title":"Tiddler Three with spaces"
   }
]

However... while this minimal JSON can be imported into TiddlyWiki, it lack 
a few fields that make things work better.  Specifically, because the 
tiddler in this JSON file don't have any "created" or "modified" fields 
defined, they won't initially show up in the Recent tab in the TW sidebar 
(they can still be found by using the "More > All" tab in the sidebar).

To make things work well right from the start, here's what I consider to be 
an effective minimal JSON file:
[
   {
      "created":"20200621234617853",
      "title":"TiddlerOne",
      "modified":"20200621234625900"
   },
   {
      "created":"20200621234629958",
      "title":"TiddlerTwo",
      "modified":"20200621234637103"
   },
   {
      "created":"20200621234639688",
      "title":"Tiddler Three with spaces",
      "modified":"20200621234652570"
   }
]

Note that each tiddler has both a "created" and "modified" field defined.  
The timestamp format for these fields is:
YYYY0MM0DD0hh0mm0ss0XXX

That is:
4 digit year
2 digit month
2 digit day
2 digit hours
2 digit minutes
2 digit seconds
3 digit millisecond

Note that all values (except for the year) are zero-padded... i.e., July 
4th 2020 at 12:15:30pm would be: "20200704121430000"

For your purposes, you could just use midnight on the current day, i.e. 
"20200621000000000".

Also, as already noted by John Edwards, field names cannot have spaces, but 
can have underscores instead, so you will have to fix that as well.

Hopefully, the above info is enough to get your data successfully imported 
as tiddlers.

Let me know how it goes...

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: http://TiddlyTools.com/InsideTW








-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a766e2f7-d65f-44ae-bb4b-d645d13baa49o%40googlegroups.com.

Reply via email to