Re: [WebDNA] WebDNA development

This WebDNA talk-list message is from

2017


It keeps the original formatting.
numero = 113444
interpreted = N
texte = 1039 Hi Tom! I suppose you could try something like this: first, create the = table, something like this should work fine [JSONstore table=3DtabJSONPARSE] JSONobject [/JSONstore] you do not need to know the exact structure of the incoming JSON = response, WebDNA will do it for you (I have personally not tested with a = table, but it does with a db) Then, you can use [convertwords]: [convertwords table=3DtabJSONPARSE]error:type and = error:message[/convertwords] This should work=E2=80=A6 - chris > On Mar 4, 2017, at 16:59, Tom Duke wrote: >=20 > Chris, >=20 > Hi - I'm using [jsonstore] and it's great to have it. It's not a = flexible as [xmlparse] though. >=20 > So if I want to pull out the error message from a Stripe.com json = response I have to do the following: >=20 > [table = name=3DtabJSONPARSE&fields=3DtID,error:type,error:message][/table][!] > [/!][jsonstore = table=3DtabJSONPARSE][varSTRIPERESPONSE][/jsonstore][!] > [/!][search = table=3DtabJSONPARSE&netIDdatarq=3Dfind_all][founditems][!] > [/!][text]error:type=3D[error:type][/text][!] > = [/!][text]error:message=3D[error:message][/text][!] > [/!][/founditems][/search] >=20 > Only then can I access the variable [error:message]. I also need to = know the exact structure of the incoming JSON response so I can set up = the table correctly. >=20 > If we had similar functionality to [xmlparse] then I could do = something like: >=20 > [jsonparse = var=3Djson_var1][varSTRIPERESPONSE][/jsonparse] > [jsonnode = ref=3Djson_var1&path=3Dnamed:error:message][value][/jsonnode] >=20 > It would also be great to be able to traverse the JSON response, = particularly if we are not sure about the structure of the incoming JSON >=20 > [jsonnodes ref=3Djson_var1] > [name]=3D[value] > [/jsonnodes] >=20 >=20 > - Tom >=20 >=20 >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Digital Revolutionaries > 1st Floor, Castleriver House > 14-15 Parliament Street > Temple Bar,Dublin 2 > Ireland > ---------------------------------------------- > [t]: + 353 1 4403907 > [e]: > [w]: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > On 3 March 2017 at 15:27, wrote: > Hi Tom! WebDNA already includes a JSON parser, that takes any JSON = Object, parse and store it: it will automatically create the database if = it does not exist, create the fields and populate it. >=20 > http://www.webdna.us/page.dna?numero=3D307 >=20 > =46rom this, it is easy to use the data by treating the database (or = table) like any other WebDNA database. >=20 > best regards, >=20 > - chris >=20 >=20 >=20 > > On Mar 3, 2017, at 15:57, Tom Duke wrote: > > > > Chris, > > > > Hi - great to hear that you are working on this. > > > > The features that I would love to see are: > > > > > > [json_encode]{data}[/json_encode] > > > > It would operate the same as the matching PHP function: = http://www.php.net/manual/en/function.json-encode.php > > > > So the data would be a WebDNA array and/or perhaps name/value pairs = separated by line returns. Nested JSON would require some thought, some = ideas here: = http://stackoverflow.com/questions/15810257/create-nested-json-object-in-p= hp > > > > > > [json_parse]{data}[/json_parse] > > > > It would operate in a similar way to [xmlparse] allowing us to = traverse and extract the JSON data by node. Also similar to the PHP = json_decode function: = http://www.php.net/manual/en/function.json-decode.php > > > > > > > > - Tom > > > > > > > > > > > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Digital Revolutionaries > > 1st Floor, Castleriver House > > 14-15 Parliament Street > > Temple Bar,Dublin 2 > > Ireland > > ---------------------------------------------- > > [t]: + 353 1 4403907 > > [e]: > > [w]: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > On 27 February 2017 at 14:24, = wrote: > > Hello, > > > > we are interested to expand and develop the JSON capabilities and = compatibility of WebDNA, particularly treating JSON-formatted returns = from javascript as well as submitting JSON-formatted info to external = programs and applications. > > > > If you have any related ideas, we are listening! :-) > > > > - chris--------------------------------------------------------- > > This message is sent to you because you are subscribed to > > the mailing list . > > To unsubscribe, E-mail to: > > archives: http://mail.webdna.us/list/talk@webdna.us > > Bug Reporting: support@webdna.us > > > > --------------------------------------------------------- This = message is sent to you because you are subscribed to the mailing list . = To unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us >=20 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] WebDNA Development server (William DeVaul 2018)
  2. Re: [WebDNA] WebDNA Development server (Stuart Tremain 2018)
  3. Re: [WebDNA] WebDNA development (Tom Duke 2017)
  4. Re: [WebDNA] WebDNA development (Tom Duke 2017)
  5. Re: [WebDNA] WebDNA development (christophe.billiottet@webdna.us 2017)
  6. Re: [WebDNA] WebDNA development (Tom Duke 2017)
  7. Re: [WebDNA] WebDNA development (christophe.billiottet@webdna.us 2017)
  8. Re: [WebDNA] WebDNA development (Tom Duke 2017)
  9. [WebDNA] WebDNA development (christophe.billiottet@webdna.us 2017)
1039 Hi Tom! I suppose you could try something like this: first, create the = table, something like this should work fine [JSONstore table=3DtabJSONPARSE] JSONobject [/JSONstore] you do not need to know the exact structure of the incoming JSON = response, WebDNA will do it for you (I have personally not tested with a = table, but it does with a db) Then, you can use [convertwords]: [convertwords table=3DtabJSONPARSE]error:type and = error:message[/convertwords] This should work=E2=80=A6 - chris > On Mar 4, 2017, at 16:59, Tom Duke wrote: >=20 > Chris, >=20 > Hi - I'm using [JSONstore] and it's great to have it. It's not a = flexible as [xmlparse] though. >=20 > So if I want to pull out the error message from a Stripe.com json = response I have to do the following: >=20 > [table = name=3DtabJSONPARSE&fields=3DtID,error:type,error:message][/table][!] > [/!][jsonstore = table=3DtabJSONPARSE][varSTRIPERESPONSE][/jsonstore][!] > [/!][search = table=3DtabJSONPARSE&netIDdatarq=3Dfind_all][founditems][!] > [/!][text]error:type=3D[error:type][/text][!] > = [/!][text]error:message=3D[error:message][/text][!] > [/!][/founditems][/search] >=20 > Only then can I access the variable [error:message]. I also need to = know the exact structure of the incoming JSON response so I can set up = the table correctly. >=20 > If we had similar functionality to [xmlparse] then I could do = something like: >=20 > [jsonparse = var=3Djson_var1][varSTRIPERESPONSE][/jsonparse] > [jsonnode = ref=3Djson_var1&path=3Dnamed:error:message][value][/jsonnode] >=20 > It would also be great to be able to traverse the JSON response, = particularly if we are not sure about the structure of the incoming JSON >=20 > [jsonnodes ref=3Djson_var1] > [name]=3D[value] > [/jsonnodes] >=20 >=20 > - Tom >=20 >=20 >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Digital Revolutionaries > 1st Floor, Castleriver House > 14-15 Parliament Street > Temple Bar,Dublin 2 > Ireland > ---------------------------------------------- > [t]: + 353 1 4403907 > [e]: > [w]: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > On 3 March 2017 at 15:27, wrote: > Hi Tom! WebDNA already includes a JSON parser, that takes any JSON = Object, parse and store it: it will automatically create the database if = it does not exist, create the fields and populate it. >=20 > http://www.webdna.us/page.dna?numero=3D307 >=20 > =46rom this, it is easy to use the data by treating the database (or = table) like any other WebDNA database. >=20 > best regards, >=20 > - chris >=20 >=20 >=20 > > On Mar 3, 2017, at 15:57, Tom Duke wrote: > > > > Chris, > > > > Hi - great to hear that you are working on this. > > > > The features that I would love to see are: > > > > > > [json_encode]{data}[/json_encode] > > > > It would operate the same as the matching PHP function: = http://www.php.net/manual/en/function.json-encode.php > > > > So the data would be a WebDNA array and/or perhaps name/value pairs = separated by line returns. Nested JSON would require some thought, some = ideas here: = http://stackoverflow.com/questions/15810257/create-nested-json-object-in-p= hp > > > > > > [json_parse]{data}[/json_parse] > > > > It would operate in a similar way to [xmlparse] allowing us to = traverse and extract the JSON data by node. Also similar to the PHP = json_decode function: = http://www.php.net/manual/en/function.json-decode.php > > > > > > > > - Tom > > > > > > > > > > > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Digital Revolutionaries > > 1st Floor, Castleriver House > > 14-15 Parliament Street > > Temple Bar,Dublin 2 > > Ireland > > ---------------------------------------------- > > [t]: + 353 1 4403907 > > [e]: > > [w]: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > On 27 February 2017 at 14:24, = wrote: > > Hello, > > > > we are interested to expand and develop the JSON capabilities and = compatibility of WebDNA, particularly treating JSON-formatted returns = from javascript as well as submitting JSON-formatted info to external = programs and applications. > > > > If you have any related ideas, we are listening! :-) > > > > - chris--------------------------------------------------------- > > This message is sent to you because you are subscribed to > > the mailing list . > > To unsubscribe, E-mail to: > > archives: http://mail.webdna.us/list/talk@webdna.us > > Bug Reporting: support@webdna.us > > > > --------------------------------------------------------- This = message is sent to you because you are subscribed to the mailing list . = To unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us >=20 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us . christophe.billiottet@webdna.us

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

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...

Related Readings:

Drop Down Menus (2002) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) requiring form fields? (2000) Cart date/time (2006) Passing Variable (was How to add product size) (1997) Web Catalog Hosting (2001) Database Options (1997) Setting up WebCatalog with Retail Pro data (1996) Sharing DBs across domains (2001) carriage returns in data (1997) NT b19 sends extra MIME headers (1997) [WebDNA] High-profile WebDNA sites? (2008) webcat- multiple selection in input field (1997) FINAL: STILL not starting on bootup (2002) Hiding HTML and page breaks (1997) Initiating NewCart (1997) WebCatalog for guestbook ? (1997) PIXO (1997) emailer w/F2 (1997) Appendfile memory usage (redux) (2003)