The "Deserializer" for "application/json" files that are Objects (with
minimum "title" field), or Arrays of such objects, does include a check to
see if the value is a string:
```
if(typeof incomingFields[f] === "string") { fields[f] = incomingFields[f]; }
```
This is stripping out your other data.
I have a set of JSON tools that helps around this issue:
https://chronicles.wiki/TW5-JsonMangler/
The worflow would be to drag& drop the JSON file into a wiki with the
plugin installed, and use the Import tools in the JSON tiddler's toolbar to
import each object as its own tiddler.
You can even map json field names to tiddler field names, and there's some
other options.
Best,
Joshua Fontany
On Wednesday, August 18, 2021 at 12:45:50 PM UTC-7 springer wrote:
> JKM,
>
> After putting quotes around your numbers (and fixing where a So-called
> "smart" quote had crept in during my editing, sorry about my earlier post,
> now deleted), both records import fine for me.
>
> I have found that raw numbers for field content (as in your kbarating
> field) will not work; only data enclosed in quote marks seems to work.
>
> Note the field data (beyond title and text) doesn't show in the import
> preview tiddler. But the data should be in there, as you can confirm by
> entering edit mode for the tiddlers once imported.
>
> -Springer
>
> On Wednesday, August 18, 2021 at 2:22:26 PM UTC-4 [email protected] wrote:
>
>> New member here. Windows, TiddlyDesktop v0.0.14, TW 5.1.23
>>
>> I'm able to import tiddlers from json with the title and text fields.
>> But when I try to do it with a custom field the import tiddler shows no
>> items to import. All my custom fields begin with *kba* and some
>> additional alphanumeric characters. The json is valid according to
>> jsonchecker.com. Is this permitted? Do I need to enable a feature or
>> preconfigure a system component? I've done a few searches in the group but
>> didn't see anything that applied. All help is appreciated.
>>
>> Imports:
>> [
>> {
>> "title": "000019464",
>> "text": "How to change the default root password"
>> },
>> {
>> "title": "000020508",
>> "text": "Best Practices"
>> }
>> ]
>>
>> Doesn't import:
>> [
>> {
>> "title": "000019464",
>> "text": "How to change the default root password",
>> "kbalink": " https://www.someplace.net/ 000019464",
>> "kbarating": 3,
>> "kbasev": 0,
>> "kbasource": "LKBA",
>> "kbastale": 0,
>> "kbatweak": "",
>> "kbatype": "How To"
>> },
>> {
>> "title": "000020508",
>> "text": "Best Practices",
>> "kbalink": "https://www.someplace.net/000020508",
>> "kbarating": 5,
>> "kbasev": 0,
>> "kbasource": "LKBA",
>> "kbastale": 0,
>> "kbatweak": "",
>> "kbatype": "Info"
>> }
>> ]
>>
>
--
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/0defbb9d-fd65-40c3-baa1-33e091f36f3en%40googlegroups.com.