<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>18 Nov 2020 18:39:35 Z</lastBuildDate><pubDate>13 Nov 2020 12:30:13 Z</pubDate><description>I state to be brand new with windev, I have to create a json like this:&#13;
[&#13;
    {&#13;
        "cassa": "9900000000011",&#13;
        "importo": [&#13;
            "0000000009001",&#13;
            "9900000000011",&#13;
            "000000001"&#13;
        ]},&#13;
    {&#13;
        "cassa": "9900000000028",&#13;
        "importo": [&#13;
            "0000000009002",&#13;
            "9900000000028",&#13;
            "000000002"&#13;
        ]&#13;
    }&#13;
 ]&#13;
&#13;
i try with this code:&#13;
vCass	is Variant&#13;
vDett	is Variant&#13;
&#13;
HExecuteQuery(QRY_testxarray,hQueryDefault)&#13;
Res is Variant&#13;
vXCass is int&#13;
FOR EACH QRY_testxarray &#13;
	&#13;
	vXCass=QRY_testxarray.cassa&#13;
	&#13;
	&#13;
	HExecuteQuery(QRY_cassaTrans,hQueryDefault,vXCass)&#13;
	ArrayDeleteAll(vDett)&#13;
	&#13;
FOR EACH QRY_cassaTrans&#13;
&#13;
	Add(vDett, QRY_cassaTrans.importo)&#13;
&#13;
	END&#13;
Res.cassa=vXCass&#13;
Res.Importo = vDett&#13;
END&#13;
&#13;
&#13;
Info(VariantToJSON(Res,psdFormatting))&#13;
ToClipboard(VariantToJSON(Res,psdFormatting))&#13;
&#13;
but the result is that I can only get a bad record:&#13;
{&#13;
	"cassa":53,&#13;
	"Importo":&#13;
	[&#13;
		1285,&#13;
		2530,&#13;
		7280&#13;
	]&#13;
}&#13;
&#13;
the queries are correct but I probably didn't understand how to handle variables correctly</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp</link><title>Create JSON from queries</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>marcov</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68126/read.awp</comments><pubDate>18 Nov 2020 18:39:35 Z</pubDate><description>I HAVE SOLVED&#13;
&#13;
x_struct is Structure&#13;
	 ca is string&#13;
	 imp is array of string&#13;
END&#13;
&#13;
x is x_struct&#13;
bufVbuffer is Buffer&#13;
ar…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68126/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68126/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp">Create JSON from queries</source><title>Re: Create JSON from queries</title></item><item><author>marcov</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68125/read.awp</comments><pubDate>18 Nov 2020 16:35:37 Z</pubDate><description>hi  Chura WALLY,&#13;
&#13;
the result of youir code is:&#13;
[ { "cassa":2, "Importo":4000 }, { "cassa":3, "Importo":860 }, { "cassa":3, "I…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68125/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68125/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp">Create JSON from queries</source><title>Re: Create JSON from queries</title></item><item><author>Chura WALLY</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68124/read.awp</comments><pubDate>18 Nov 2020 00:33:31 Z</pubDate><description>hola amigo pienso que necesitas esto &#13;
x is variant &#13;
array_x is array of variant &#13;
&#13;
FOR EACH QRY_cassaTrans&#13;
	x.cassa =QRY_cas…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68124/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68124/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp">Create JSON from queries</source><title>Re: Create JSON from queries</title></item><item><author>Andrea Chiadò Piat</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68120/read.awp</comments><pubDate>17 Nov 2020 10:16:40 Z</pubDate><description>Ok, I don't know exactly what is wrong, but I think you can try to use a structure instead of a variant to fill your data from q…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68120/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68120/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp">Create JSON from queries</source><title>Re: Create JSON from queries</title></item><item><author>marcov</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68119/read.awp</comments><pubDate>16 Nov 2020 21:12:14 Z</pubDate><description>Hi, the queries must be two, in my opinion the problem is that I can't create an array consisting of a field from the first quer…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68119/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68119/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp">Create JSON from queries</source><title>Re: Create JSON from queries</title></item><item><author>Andrea Chiadò Piat</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68117/read.awp</comments><pubDate>16 Nov 2020 16:52:19 Z</pubDate><description>Probably you have to do something to format your query output...&#13;
Anyway, have you tried HExportJSON?&#13;
https://help.windev.com/e…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68117/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68117/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp">Create JSON from queries</source><title>Re: Create JSON from queries</title></item><item><author>marcov</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68114/read.awp</comments><pubDate>16 Nov 2020 14:05:37 Z</pubDate><description>i try but i have same result</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68114/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68114/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp">Create JSON from queries</source><title>Re: Create JSON from queries</title></item><item><author>marcov</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68113/read.awp</comments><pubDate>16 Nov 2020 11:22:19 Z</pubDate><description>hi,&#13;
&#13;
 use the express version 25 because I would like to test some aspects</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68113/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68113/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp">Create JSON from queries</source><title>Re: Create JSON from queries</title></item><item><author>Andrea Chiadò Piat</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68112/read.awp</comments><pubDate>16 Nov 2020 09:54:55 Z</pubDate><description>Hi Marco,&#13;
what version of wd are you using?&#13;
Because from v24 you can create a json variable directly&#13;
https://help.windev.com/…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68112/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries-68112/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68108-create-json-from-queries/read.awp">Create JSON from queries</source><title>Re: Create JSON from queries</title></item></channel></rss>
