va=r mydata =3D =C2=A0=C2=A0 {"list"=;: =C2=A0
Hello everyone!
With Josh (who is behind all the C++ code these last years), we spent some =time thinking about this. He made a proof of concept C++ app that gives the= below output when we feed it the JSON from Mike's post to the mailing =list. Is this useful? If this is acceptable, we can adapt the code into the= WebDNA source tree and have it store in the DB/table in that format.
page=3D1
total_results=3D21
total_pages=3D1
results:1:popularity=3D1.936
results:1:vote_count=3D7
results:2:popularity=3D2.732
results:2:vote_count=3D23
results:3:popularity=3D12.088
results:3:vote_count=3D75
results:4:popularity=3D53.221
results:4:vote_count=3D5
results:5:popularity=3D7.001
results:5:vote_count=3D31
results:6:popularity=3D22.223
results:6:vote_count=3D88
Next version would have this fix built-in.
- chris
> On May 1, 2020, at 06:03, talk@webdna.us wrote:
>
> Hi Mike.
>
> Ah yes, I can see why you need to do it natively.
>
> Sorry, I am out of silver bullets now :(
>
>
> Kind regards
>
> Stuart Tremain
> Pharoah Lane Software
> AUSTRALIA
> webdna@p=lsoftware.com.au
>
>
>
>
>
>
>
>> On 1 May 2020, at 12:52, talk@webdna.us wrote:
>>
>> Stuart,
>>
>> I actually use this (Tom=E2=80=99s routine) as the basis of what I==E2=80=99m doing now.=C2=A0 The challenge I=E2=80=99m facing in my current =project is that the source JSON is quite large, and the specific data I nee=d is near the end of the data, nested in several layers of arrays.=C2=A0 Th=e parsing time is around 90 seconds.=C2=A0 I need to speed that up.
>>
>>
>> Mike Davis
>>
>>> On Apr 30, 2020, at 5:04 PM, talk@webdna.us wrote:
>>>
>>> I am not sure if this is exactly what Tom wrote, but it is wha=t I am using.
>>>
>>>
>>> [!]------------------- Pass json as JSONRESULT ---------------=--
>>> ------------------- Conversion table to strip non-breaking spa=ces -----------------
>>> [/!][TABLE name=3DjsonClean&fields=3Dfrom,to]
>>> %C2
>>> %A0
>>> [/TABLE][!]
>>>
>>> ------------------- Conversion table to facilitate spliting in=to key:value pairs -----------------
>>> [/!][TABLE name=3DjsonSplitConversions&fields=3Dfrom,to]>>> |=C2=A0 =C2=A0~~~~
>>> \"=C2=A0 ^^^^
>>> [/TABLE][!]
>>>
>>> ------------------- Convert back after spliting into key:value= pairs -----------------
>>> [/!][TABLE name=3DjsonSplitConversionsBack&fields=3Dfrom,t=o]
>>> "=C2=A0 =C2=A0
>>> ~~~~=C2=A0 =C2=A0 =C2=A0 =C2=A0 |
>>> ^^^^=C2=A0 =C2=A0 =C2=A0 =C2=A0 "
>>> [/TABLE][!]
>>>
>>> ------------------- pass one - run the conversions -----------=------
>>> [/!][TEXT]JSONRESULT=3D[CONVERTWORDS table=3DjsonSplitConversi=ons][convertchars table=3DjsonClean][JSONRESULT][/convertchars][/CONVERTWOR=DS][/TEXT][!]
>>>
>>> ------------------- pass two - add bar to just before each key=:value pair -----------------
>>> [/!][TEXT]JSONRESULT=3D[GREP search=3D("[^"]*")=:&replace=3D|\1=3D][JSONRESULT][/GREP][/TEXT][!]
>>>
>>> ------------------- pass three - list out the key:value pairs =and assign them to text variables -----------------
>>> [/!][LISTWORDS words=3D[url][JSONRESULT][/url]&delimiters==3D|{}][!]
>>>=C2=A0 =C2=A0 =C2=A0[/!][TEXT]THISVAL=3D[GREP search=3D(,$)&=;replace=3D][GETCHARS start=3D1&trim=3Dboth][CONVERTWORDS table=3DjsonS=plitConversionsBack][word][/CONVERTWORDS][/GETCHARS][/GREP][/TEXT][!]
>>>=C2=A0 =C2=A0 =C2=A0[/!][HIDEIF [url][THISVAL][/url]=3D][!]
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][TEXT]JSON-=[THISVAL][/TEXT][!]
>>>=C2=A0 =C2=A0 =C2=A0[/!][/HIDEIF][!]
>>> [/!][/LISTWORDS]
>>>
>>>
>>>
>>>
>>>
>>> Kind regards
>>>
>>> Stuart Tremain
>>> Pharoah Lane Software
>>> AUSTRALIA
>>> =webdna@plsoftware.com.au
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>> On 1 May 2020, at 08:10, talk@webdna.us wrote:
>>>>
>>>> Hi Stuart,
>>>>
>>>> I appreciate your answer and have a similar kludge (creati=ve solution) for my application.=C2=A0 I was actually hoping to hear from C=hris on this, in hopes that the underlying JSON parser he is using can be p=assed dot notation in a similar way that Javascript uses to parse JSON obje=cts.
>>>>
>>>> Chris, are there any parameters we can send that are not i=n the documentation?
>>>>
>>>>
>>>>
>>>> Thanks,
>>>> Mike Davis
>>>>
>>>>> On Apr 22, 2020, at 5:05 PM, talk@webdna.us wrote:
>>>>>
>>>>> Hi MD
>>>>>
>>>>> As we don=E2=80=99t know the email address of the send=er anymore it would be nice for us to know who we are addressing.
>>>>>
>>>>> The JSONStore tag is a little confusing and what is al=so not well documented is that you can store the data in a table eg:
>>>>>
>>>>>
>>>>> [JSONstore table=3DTRANSACTION&fields=3Derror:type=,error:message]
>>>>> [STRIPERESPONSE]
>>>>> [/JSONstore]
>>>>>
>>>>> Then search the table:
>>>>>
>>>>> [SEARCH table=3DTRANSACTION&neERROR:TYPEdatarq=3D[=BLANK]][!]
>>>>>=C2=A0 =C2=A0[/!][FOUNDITEMS][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][TEXT]ERRO=R-TYPE=3D[ERROR:TYPE][/TEXT][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][TEXT]ERRO=R-MESSAGE=3D[ERROR:MESSAGE][/TEXT][!]
>>>>>=C2=A0 =C2=A0[/!][/FOUNDITEMS][!]
>>>>> [/!][/SEARCH]
>>>>>
>>>>>
>>>>> What I found to be a useful exercise was to write to m=y specified db and then open it and read the data to see what is being done= with it. JSONsStore will write the headers in a db
>>>>>
>>>>> [JSONstore db=3Dlogs/stripelog.db]
>>>>> [STRIPERESPONSE]
>>>>> [/JSONstore]
>>>>>
>>>>> As the data is often stored in an array you will have =to do a bit of manipulation on the found items.
>>>>>
>>>>> Here is a JSON function that may be useful to you.
>>>>>
>>>>>
>>>>> [!]---------------------------------------------------=-------------------
>>>>> FUNCTION Name: WC-JSONvalue
>>>>>=C2=A0 =C2=A0+ Description: Pull out a value from a JSO=Nobject
>>>>>=C2=A0 =C2=A0+ Input:
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0JSONobject =3D (the j=son to be parsed) - required
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0JSONnode =3D (the nod=e that we want the value of) - required
>>>>>=C2=A0 =C2=A0+ usage: [WC-JSONvalue JSONobject=3D[url]&=lt;the-json-object>[/url]&JSONnode=3D<the-json-node>]
>>>>>=C2=A0 =C2=A0+Note: This function MUST receive valid JS=ONobject, make sure that there are no line breaks before beginning of JSON,= test your JSON validity here: https://jsonlint.com
>>>>> ------------------------------------------------------=----------------
>>>>> [/!][function name=3DWC-JSONvalue][!]
>>>>>=C2=A0 =C2=A0[/!][text]rRETURN=3D[/text][!]
>>>>>=C2=A0 =C2=A0[/!][text]rJSONobject=3D[/text][!]
>>>>>=C2=A0 =C2=A0[/!][text]rJSONnode=3Dnull[/text][!]
>>>>>=C2=A0 =C2=A0[/!][showif [url][params_string][/url]^JSO=Nobject][text]rJSONobject=3D[JSONobject][/text][/showif][!]
>>>>>=C2=A0 =C2=A0[/!][showif [url][params_string][/url]^JSO=Nnode][text]rJSONnode=3D[JSONnode][/text][/showif][!]
>>>>>=C2=A0 =C2=A0--------------------=C2=A0 Store the JSONo=bject in a table=C2=A0 --------------------
>>>>>=C2=A0 =C2=A0[/!][JSONstore table=3DJSONdata][rJSONobje=ct][/jsonstore][!]
>>>>>=C2=A0 =C2=A0--------------------=C2=A0 Search the tabl=e=C2=A0 --------------------
>>>>>=C2=A0 =C2=A0[/!][SEARCH table=3DJSONdata&ne[rJSONn=ode]data=3Dfind_all][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][founditem=s][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0[/!][text]rRETURN=3D[interpret][[rJSONnode]][/interpret][/tex=t][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][/foundite=ms][!]
>>>>>=C2=A0 =C2=A0[/!][/SEARCH][!]
>>>>>=C2=A0 =C2=A0--------------------=C2=A0 Return the valu=e=C2=A0 --------------------
>>>>>=C2=A0 =C2=A0[/!][return][rRETURN][/return][!]
>>>>> [/!][/function]
>>>>>
>>>>> You man need to play around with the json object to en=sure that it is valid json, I found that PayPal json did not validate.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Kind regards
>>>>>
>>>>> Stuart Tremain
>>>>> Pharoah Lane Software
>>>>> AUSTRALIA
>>>>> webdna@plsoftware.com.au
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On 23 Apr 2020, at 06:45, talk@webdna.us wrote:
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I=E2=80=99m looking at the docs for the JSONStore =context.=C2=A0 It seems that either the context is lacking functionality or= the documentation is.=C2=A0 I do not see a way to access nested levels in =the JSON, like can be done with XML using path=3D0:1:2 for example.=C2=A0 S=eems like there should be a way to use dot notation to get at nested data w=ithout storing each array in a temp db, then reparsing each level with JSON=Store into another temp db, etc.
>>>>>>
>>>>>> For example:=C2=A0 I want to iterate the data sets= in the =E2=80=9Cresults=E2=80=9D array into a database.=C2=A0 I can use JS=ONStore to populate a table with the fields: page, total_results, total_pag=es and results.=C2=A0 =C2=A0Then I can search that table and run JSONStore =on the results field using another database, but this gets a bit complicate=d when working with some other data, in which I need to access data that is= 3 or 4 arrays deep.
>>>>>>
>>>>>> Anyone solved this puzzle in a more efficient way =yet?
>>>>>>
>>>>>> {
>>>>>>=C2=A0 =C2=A0 "page":1,
>>>>>>=C2=A0 =C2=A0 "total_results":21,
>>>>>>=C2=A0 =C2=A0 "total_pages":1,
>>>>>>=C2=A0 =C2=A0 "results=E2=80=9D:[
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity":1.936,"vote_count=E2=80=9D:7
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:2.732,"vote_count=E2=80=9D:23
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:12.088,"vote_count=E2=80=9D:75
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:53.221,"vote_count=E2=80=9D:5
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:7.001,"vote_count=E2=80=9D:31
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:22.223,"vote_count=E2=80=9D:88
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>>>>>=C2=A0 =C2=A0 ]
>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> MD------------------------------------------------=---------
>>>>>> This message is sent to you because you are subscr=ibed to
>>>>>> the mailing list talk@webdna.us
>>>>>> To unsubscribe, E-mail to: talk-leave@webdna.us
>>>>>> archives: http://www.webdna.us/pag=e.dna?numero=3D55
>>>>>> Bug Reporting: support@webdna.us
>>>>>
>>>>> ------------------------------------------------------=--- This message is sent to you because you are subscribed to the mailing l=ist talk@webdna.us =To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.w=ebdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us
>>>>
>>>> --------------------------------------------------------- =This message is sent to you because you are subscribed to the mailing list =talk@webdna.us To u=nsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.=us/page.dna?numero=3D55 Bug Reporting: support@webdna.us
>>>
>>> --------------------------------------------------------- This= message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsub=scribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/p=age.dna?numero=3D55 Bug Reporting: support@webdna.us
>>
>> --------------------------------------------------------- This mes=sage is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscr=ibe, E-mail to: t=alk-leave@webdna.us archives: http://www.webdna.us/page=..dna?numero=3D55 Bug Reporting: support@webdna.us
>
> --------------------------------------------------------- This message= is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, =E-mail to: talk-l=eave@webdna.us archives: http://www.webdna.us/page.dna?=numero=3D55 Bug Reporting: support@webdna.us
---------------------------------------------------------
This message is sent to you because you are subscribed to
the mailing list talk@w=ebdna.us
To unsubscribe, E-mail to: talk-leave@webdna.us
archives: http://www.webdna.us/page.dna?numero=3D55
Bug Reporting: suppo=rt@webdna.us
va=r mydata =3D =C2=A0=C2=A0 {"list"=;: =C2=A0
Hello everyone!
With Josh (who is behind all the C++ code these last years), we spent some =time thinking about this. He made a proof of concept C++ app that gives the= below output when we feed it the JSON from Mike's post to the mailing =list. Is this useful? If this is acceptable, we can adapt the code into the= WebDNA source tree and have it store in the DB/table in that format.
page=3D1
total_results=3D21
total_pages=3D1
results:1:popularity=3D1.936
results:1:vote_count=3D7
results:2:popularity=3D2.732
results:2:vote_count=3D23
results:3:popularity=3D12.088
results:3:vote_count=3D75
results:4:popularity=3D53.221
results:4:vote_count=3D5
results:5:popularity=3D7.001
results:5:vote_count=3D31
results:6:popularity=3D22.223
results:6:vote_count=3D88
Next version would have this fix built-in.
- chris
> On May 1, 2020, at 06:03, talk@webdna.us wrote:
>
> Hi Mike.
>
> Ah yes, I can see why you need to do it natively.
>
> Sorry, I am out of silver bullets now :(
>
>
> Kind regards
>
> Stuart Tremain
> Pharoah Lane Software
> AUSTRALIA
> webdna@p=lsoftware.com.au
>
>
>
>
>
>
>
>> On 1 May 2020, at 12:52, talk@webdna.us wrote:
>>
>> Stuart,
>>
>> I actually use this (Tom=E2=80=99s routine) as the basis of what I==E2=80=99m doing now.=C2=A0 The challenge I=E2=80=99m facing in my current =project is that the source JSON is quite large, and the specific data I nee=d is near the end of the data, nested in several layers of arrays.=C2=A0 Th=e parsing time is around 90 seconds.=C2=A0 I need to speed that up.
>>
>>
>> Mike Davis
>>
>>> On Apr 30, 2020, at 5:04 PM, talk@webdna.us wrote:
>>>
>>> I am not sure if this is exactly what Tom wrote, but it is wha=t I am using.
>>>
>>>
>>> [!]------------------- Pass json as JSONRESULT ---------------=--
>>> ------------------- Conversion table to strip non-breaking spa=ces -----------------
>>> [/!][TABLE name=3DjsonClean&fields=3Dfrom,to]
>>> %C2
>>> %A0
>>> [/TABLE][!]
>>>
>>> ------------------- Conversion table to facilitate spliting in=to key:value pairs -----------------
>>> [/!][TABLE name=3DjsonSplitConversions&fields=3Dfrom,to]>>> |=C2=A0 =C2=A0~~~~
>>> \"=C2=A0 ^^^^
>>> [/TABLE][!]
>>>
>>> ------------------- Convert back after spliting into key:value= pairs -----------------
>>> [/!][TABLE name=3DjsonSplitConversionsBack&fields=3Dfrom,t=o]
>>> "=C2=A0 =C2=A0
>>> ~~~~=C2=A0 =C2=A0 =C2=A0 =C2=A0 |
>>> ^^^^=C2=A0 =C2=A0 =C2=A0 =C2=A0 "
>>> [/TABLE][!]
>>>
>>> ------------------- pass one - run the conversions -----------=------
>>> [/!][text]JSONRESULT=3D[CONVERTWORDS table=3DjsonSplitConversi=ons][convertchars table=3DjsonClean][JSONRESULT][/convertchars][/CONVERTWOR=DS][/TEXT][!]
>>>
>>> ------------------- pass two - add bar to just before each key=:value pair -----------------
>>> [/!][text]JSONRESULT=3D[GREP search=3D("[^"]*")=:&replace=3D|\1=3D][JSONRESULT][/GREP][/TEXT][!]
>>>
>>> ------------------- pass three - list out the key:value pairs =and assign them to text variables -----------------
>>> [/!][LISTWORDS words=3D[url][JSONRESULT][/url]&delimiters==3D|{}][!]
>>>=C2=A0 =C2=A0 =C2=A0[/!][text]THISVAL=3D[GREP search=3D(,$)&=;replace=3D][GETCHARS start=3D1&trim=3Dboth][CONVERTWORDS table=3DjsonS=plitConversionsBack][word][/CONVERTWORDS][/GETCHARS][/GREP][/TEXT][!]
>>>=C2=A0 =C2=A0 =C2=A0[/!][HIDEIF [url][THISVAL][/url]=3D][!]
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][text]JSON-=[THISVAL][/TEXT][!]
>>>=C2=A0 =C2=A0 =C2=A0[/!][/HIDEIF][!]
>>> [/!][/LISTWORDS]
>>>
>>>
>>>
>>>
>>>
>>> Kind regards
>>>
>>> Stuart Tremain
>>> Pharoah Lane Software
>>> AUSTRALIA
>>> =webdna@plsoftware.com.au
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>> On 1 May 2020, at 08:10, talk@webdna.us wrote:
>>>>
>>>> Hi Stuart,
>>>>
>>>> I appreciate your answer and have a similar kludge (creati=ve solution) for my application.=C2=A0 I was actually hoping to hear from C=hris on this, in hopes that the underlying JSON parser he is using can be p=assed dot notation in a similar way that Javascript uses to parse JSON obje=cts.
>>>>
>>>> Chris, are there any parameters we can send that are not i=n the documentation?
>>>>
>>>>
>>>>
>>>> Thanks,
>>>> Mike Davis
>>>>
>>>>> On Apr 22, 2020, at 5:05 PM, talk@webdna.us wrote:
>>>>>
>>>>> Hi MD
>>>>>
>>>>> As we don=E2=80=99t know the email address of the send=er anymore it would be nice for us to know who we are addressing.
>>>>>
>>>>> The JSONStore tag is a little confusing and what is al=so not well documented is that you can store the data in a table eg:
>>>>>
>>>>>
>>>>> [JSONstore table=3DTRANSACTION&fields=3Derror:type=,error:message]
>>>>> [STRIPERESPONSE]
>>>>> [/JSONstore]
>>>>>
>>>>> Then search the table:
>>>>>
>>>>> [SEARCH table=3DTRANSACTION&neERROR:TYPEdatarq=3D[=BLANK]][!]
>>>>>=C2=A0 =C2=A0[/!][founditems][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][text]ERRO=R-TYPE=3D[ERROR:TYPE][/TEXT][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][text]ERRO=R-MESSAGE=3D[ERROR:MESSAGE][/TEXT][!]
>>>>>=C2=A0 =C2=A0[/!][/FOUNDITEMS][!]
>>>>> [/!][/SEARCH]
>>>>>
>>>>>
>>>>> What I found to be a useful exercise was to write to m=y specified db and then open it and read the data to see what is being done= with it. JSONsStore will write the headers in a db
>>>>>
>>>>> [JSONstore db=3Dlogs/stripelog.db]
>>>>> [STRIPERESPONSE]
>>>>> [/JSONstore]
>>>>>
>>>>> As the data is often stored in an array you will have =to do a bit of manipulation on the found items.
>>>>>
>>>>> Here is a JSON function that may be useful to you.
>>>>>
>>>>>
>>>>> [!]---------------------------------------------------=-------------------
>>>>> FUNCTION Name: WC-JSONvalue
>>>>>=C2=A0 =C2=A0+ Description: Pull out a value from a JSO=Nobject
>>>>>=C2=A0 =C2=A0+ Input:
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0JSONobject =3D (the j=son to be parsed) - required
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0JSONnode =3D (the nod=e that we want the value of) - required
>>>>>=C2=A0 =C2=A0+ usage: [WC-JSONvalue JSONobject=3D[url]&=lt;the-json-object>[/url]&JSONnode=3D<the-json-node>]
>>>>>=C2=A0 =C2=A0+Note: This function MUST receive valid JS=ONobject, make sure that there are no line breaks before beginning of JSON,= test your JSON validity here: https://jsonlint.com
>>>>> ------------------------------------------------------=----------------
>>>>> [/!][function name=3DWC-JSONvalue][!]
>>>>>=C2=A0 =C2=A0[/!][text]rRETURN=3D[/text][!]
>>>>>=C2=A0 =C2=A0[/!][text]rJSONobject=3D[/text][!]
>>>>>=C2=A0 =C2=A0[/!][text]rJSONnode=3Dnull[/text][!]
>>>>>=C2=A0 =C2=A0[/!][showif [url][params_string][/url]^JSO=Nobject][text]rJSONobject=3D[JSONobject][/text][/showif][!]
>>>>>=C2=A0 =C2=A0[/!][showif [url][params_string][/url]^JSO=Nnode][text]rJSONnode=3D[JSONnode][/text][/showif][!]
>>>>>=C2=A0 =C2=A0--------------------=C2=A0 Store the JSONo=bject in a table=C2=A0 --------------------
>>>>>=C2=A0 =C2=A0[/!][JSONstore table=3DJSONdata][rJSONobje=ct][/jsonstore][!]
>>>>>=C2=A0 =C2=A0--------------------=C2=A0 Search the tabl=e=C2=A0 --------------------
>>>>>=C2=A0 =C2=A0[/!][SEARCH table=3DJSONdata&ne[rJSONn=ode]data=3Dfind_all][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][founditem=s][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0[/!][text]rRETURN=3D[interpret][[rJSONnode]][/interpret][/tex=t][!]
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][/foundite=ms][!]
>>>>>=C2=A0 =C2=A0[/!][/SEARCH][!]
>>>>>=C2=A0 =C2=A0--------------------=C2=A0 Return the valu=e=C2=A0 --------------------
>>>>>=C2=A0 =C2=A0[/!][return][rRETURN][/return][!]
>>>>> [/!][/function]
>>>>>
>>>>> You man need to play around with the json object to en=sure that it is valid json, I found that PayPal json did not validate.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Kind regards
>>>>>
>>>>> Stuart Tremain
>>>>> Pharoah Lane Software
>>>>> AUSTRALIA
>>>>> webdna@plsoftware.com.au
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On 23 Apr 2020, at 06:45, talk@webdna.us wrote:
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I=E2=80=99m looking at the docs for the JSONStore =context.=C2=A0 It seems that either the context is lacking functionality or= the documentation is.=C2=A0 I do not see a way to access nested levels in =the JSON, like can be done with XML using path=3D0:1:2 for example.=C2=A0 S=eems like there should be a way to use dot notation to get at nested data w=ithout storing each array in a temp db, then reparsing each level with JSON=Store into another temp db, etc.
>>>>>>
>>>>>> For example:=C2=A0 I want to iterate the data sets= in the =E2=80=9Cresults=E2=80=9D array into a database.=C2=A0 I can use JS=ONStore to populate a table with the fields: page, total_results, total_pag=es and results.=C2=A0 =C2=A0Then I can search that table and run JSONStore =on the results field using another database, but this gets a bit complicate=d when working with some other data, in which I need to access data that is= 3 or 4 arrays deep.
>>>>>>
>>>>>> Anyone solved this puzzle in a more efficient way =yet?
>>>>>>
>>>>>> {
>>>>>>=C2=A0 =C2=A0 "page":1,
>>>>>>=C2=A0 =C2=A0 "total_results":21,
>>>>>>=C2=A0 =C2=A0 "total_pages":1,
>>>>>>=C2=A0 =C2=A0 "results=E2=80=9D:[
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity":1.936,"vote_count=E2=80=9D:7
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:2.732,"vote_count=E2=80=9D:23
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:12.088,"vote_count=E2=80=9D:75
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:53.221,"vote_count=E2=80=9D:5
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:7.001,"vote_count=E2=80=9D:31
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pop=ularity=E2=80=9D:22.223,"vote_count=E2=80=9D:88
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>>>>>=C2=A0 =C2=A0 ]
>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> MD------------------------------------------------=---------
>>>>>> This message is sent to you because you are subscr=ibed to
>>>>>> the mailing list talk@webdna.us
>>>>>> To unsubscribe, E-mail to: talk-leave@webdna.us
>>>>>> archives: http://www.webdna.us/pag=e.dna?numero=3D55
>>>>>> Bug Reporting: support@webdna.us
>>>>>
>>>>> ------------------------------------------------------=--- This message is sent to you because you are subscribed to the mailing l=ist talk@webdna.us =To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.w=ebdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us
>>>>
>>>> --------------------------------------------------------- =This message is sent to you because you are subscribed to the mailing list =talk@webdna.us To u=nsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.=us/page.dna?numero=3D55 Bug Reporting: support@webdna.us
>>>
>>> --------------------------------------------------------- This= message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsub=scribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/p=age.dna?numero=3D55 Bug Reporting: support@webdna.us
>>
>> --------------------------------------------------------- This mes=sage is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscr=ibe, E-mail to: t=alk-leave@webdna.us archives: http://www.webdna.us/page=..dna?numero=3D55 Bug Reporting: support@webdna.us
>
> --------------------------------------------------------- This message= is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, =E-mail to: talk-l=eave@webdna.us archives: http://www.webdna.us/page.dna?=numero=3D55 Bug Reporting: support@webdna.us
---------------------------------------------------------
This message is sent to you because you are subscribed to
the mailing list talk@w=ebdna.us
To unsubscribe, E-mail to: talk-leave@webdna.us
archives: http://www.webdna.us/page.dna?numero=3D55
Bug Reporting: suppo=rt@webdna.us
DOWNLOAD WEBDNA NOW!
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...