[tw5] Re: Import tiddlers w/ json including custom fields

2021-08-19 Thread John Mayes
*Thank you all!  *So glad I found this Group.  I was able to import after 
quoting the numbers.

@Soren Bjornstad - I searched for duplicates on a couple of them and they 
did not exist before the import, so I'm not sure what to make of your 
observation.  Looking forward to utilizing your Grok TiddlyWiki book and 
have already shared it with the person who introduced me to TW - He was 
impressed.  Certain appears to be a labor of love (and probably some 
frustration).
@ Joshua Fontany - I will definitely dig into your plugin.

On Wednesday, August 18, 2021 at 10:16:40 PM UTC-5 Soren Bjornstad wrote:

> By the way, when I said that the example "imported correctly" for me, it 
> indeed did not include some of the fields...for some reason I foolishly 
> decided not to mention that when I imported it even though I noticed. I am 
> not however seeing the message jkm was where $:/Import said there were no 
> tiddlers to import. So I think there are two separate problems here, the 
> existence of duplicate tiddlers *and* some of the fields not being 
> strings.
>
> On Wednesday, August 18, 2021 at 6:46:35 PM UTC-5 TW Tones wrote:
>
>> I can totally recommend Joshua's JSON mangler in cases likele this and 
>> csv.
>>
>>
>>
>> On Thursday, 19 August 2021 at 04:22:26 UTC+10 jkm...@gmail.com 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": "19464",
>>> "text": "How to change the default root password"
>>>   },
>>>   {
>>> "title": "20508",
>>> "text": "Best Practices"
>>>   }
>>> ]
>>>
>>> Doesn't import:
>>> [
>>>   {
>>> "title": "19464",
>>> "text": "How to change the default root password",
>>> "kbalink": " https://www.someplace.net/ 19464",
>>> "kbarating": 3,
>>> "kbasev": 0,
>>> "kbasource": "LKBA",
>>> "kbastale": 0,
>>> "kbatweak": "",
>>> "kbatype": "How To"
>>>   },
>>>   {
>>> "title": "20508",
>>> "text": "Best Practices",
>>> "kbalink": "https://www.someplace.net/20508;,
>>> "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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2519a9f2-d764-4f18-afb4-2a18b3e77f1bn%40googlegroups.com.


[tw5] Re: Import tiddlers w/ json including custom fields

2021-08-18 Thread Soren Bjornstad
By the way, when I said that the example "imported correctly" for me, it 
indeed did not include some of the fields...for some reason I foolishly 
decided not to mention that when I imported it even though I noticed. I am 
not however seeing the message jkm was where $:/Import said there were no 
tiddlers to import. So I think there are two separate problems here, the 
existence of duplicate tiddlers *and* some of the fields not being strings.

On Wednesday, August 18, 2021 at 6:46:35 PM UTC-5 TW Tones wrote:

> I can totally recommend Joshua's JSON mangler in cases likele this and csv.
>
>
>
> On Thursday, 19 August 2021 at 04:22:26 UTC+10 jkm...@gmail.com 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": "19464",
>> "text": "How to change the default root password"
>>   },
>>   {
>> "title": "20508",
>> "text": "Best Practices"
>>   }
>> ]
>>
>> Doesn't import:
>> [
>>   {
>> "title": "19464",
>> "text": "How to change the default root password",
>> "kbalink": " https://www.someplace.net/ 19464",
>> "kbarating": 3,
>> "kbasev": 0,
>> "kbasource": "LKBA",
>> "kbastale": 0,
>> "kbatweak": "",
>> "kbatype": "How To"
>>   },
>>   {
>> "title": "20508",
>> "text": "Best Practices",
>> "kbalink": "https://www.someplace.net/20508;,
>> "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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1332b6a2-37ab-4d59-a7a0-dc626f78394en%40googlegroups.com.


[tw5] Re: Import tiddlers w/ json including custom fields

2021-08-18 Thread TW Tones
I can totally recommend Joshua's JSON mangler in cases likele this and csv.



On Thursday, 19 August 2021 at 04:22:26 UTC+10 jkm...@gmail.com 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": "19464",
> "text": "How to change the default root password"
>   },
>   {
> "title": "20508",
> "text": "Best Practices"
>   }
> ]
>
> Doesn't import:
> [
>   {
> "title": "19464",
> "text": "How to change the default root password",
> "kbalink": " https://www.someplace.net/ 19464",
> "kbarating": 3,
> "kbasev": 0,
> "kbasource": "LKBA",
> "kbastale": 0,
> "kbatweak": "",
> "kbatype": "How To"
>   },
>   {
> "title": "20508",
> "text": "Best Practices",
> "kbalink": "https://www.someplace.net/20508;,
> "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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/69ca599c-aacc-43e5-b671-0386cc738dd0n%40googlegroups.com.


[tw5] Re: Import tiddlers w/ json including custom fields

2021-08-18 Thread Joshua Fontany
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 jkm...@gmail.com 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": "19464",
>> "text": "How to change the default root password"
>>   },
>>   {
>> "title": "20508",
>> "text": "Best Practices"
>>   }
>> ]
>>
>> Doesn't import:
>> [
>>   {
>> "title": "19464",
>> "text": "How to change the default root password",
>> "kbalink": " https://www.someplace.net/ 19464",
>> "kbarating": 3,
>> "kbasev": 0,
>> "kbasource": "LKBA",
>> "kbastale": 0,
>> "kbatweak": "",
>> "kbatype": "How To"
>>   },
>>   {
>> "title": "20508",
>> "text": "Best Practices",
>> "kbalink": "https://www.someplace.net/20508;,
>> "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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0defbb9d-fd65-40c3-baa1-33e091f36f3en%40googlegroups.com.


[tw5] Re: Import tiddlers w/ json including custom fields

2021-08-18 Thread springer
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 jkm...@gmail.com 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": "19464",
> "text": "How to change the default root password"
>   },
>   {
> "title": "20508",
> "text": "Best Practices"
>   }
> ]
>
> Doesn't import:
> [
>   {
> "title": "19464",
> "text": "How to change the default root password",
> "kbalink": " https://www.someplace.net/ 19464",
> "kbarating": 3,
> "kbasev": 0,
> "kbasource": "LKBA",
> "kbastale": 0,
> "kbatweak": "",
> "kbatype": "How To"
>   },
>   {
> "title": "20508",
> "text": "Best Practices",
> "kbalink": "https://www.someplace.net/20508;,
> "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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5f7ea174-86f7-4eab-b0d4-25cb11b726b6n%40googlegroups.com.


[tw5] Re: Import tiddlers w/ json including custom fields

2021-08-18 Thread springer
JKM, This is not much of an answer, except two comments:
(1) I regularly import JSON strings with fields, needing no further 
configuration. (The import tiddler won't show the additional fields, but 
they'll be part of the tiddler after import, as you can see once you open 
in edit mode.)
(2) 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.

I don't have time for much more testing, except to confirm that I can 
import your json data  (using copy-paste), and yet I also see a couple 
unexpected character errors, and I'm not sure why.

On Wednesday, August 18, 2021 at 2:22:26 PM UTC-4 jkm...@gmail.com 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": "19464",
> "text": "How to change the default root password"
>   },
>   {
> "title": "20508",
> "text": "Best Practices"
>   }
> ]
>
> Doesn't import:
> [
>   {
> "title": "19464",
> "text": "How to change the default root password",
> "kbalink": " https://www.someplace.net/ 19464",
> "kbarating": 3,
> "kbasev": 0,
> "kbasource": "LKBA",
> "kbastale": 0,
> "kbatweak": "",
> "kbatype": "How To"
>   },
>   {
> "title": "20508",
> "text": "Best Practices",
> "kbalink": "https://www.someplace.net/20508;,
> "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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/bd97065c-a823-4b01-98e9-abb332d40541n%40googlegroups.com.


[tw5] Re: Import tiddlers w/ json including custom fields

2021-08-18 Thread Soren Bjornstad
Your second example imports as expected for me. Is it possible tiddlers 
with the titles in your JSON already exist in the wiki? I believe there is 
a bug in 5.1.23 where it doesn't explain that to you in the import dialog 
and just silently skips them.

On Wednesday, August 18, 2021 at 1:22:26 PM UTC-5 jkm...@gmail.com 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": "19464",
> "text": "How to change the default root password"
>   },
>   {
> "title": "20508",
> "text": "Best Practices"
>   }
> ]
>
> Doesn't import:
> [
>   {
> "title": "19464",
> "text": "How to change the default root password",
> "kbalink": " https://www.someplace.net/ 19464",
> "kbarating": 3,
> "kbasev": 0,
> "kbasource": "LKBA",
> "kbastale": 0,
> "kbatweak": "",
> "kbatype": "How To"
>   },
>   {
> "title": "20508",
> "text": "Best Practices",
> "kbalink": "https://www.someplace.net/20508;,
> "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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1be11b96-c2e4-4985-aa3c-d8f364fcdd14n%40googlegroups.com.