PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → JSON Array
JSON Array
Débuté par Mister RUAN, 14 aoû. 2017 12:37 - Aucune réponse
Membre enregistré
208 messages
Popularité : +1 (1 vote)
Posté le 14 août 2017 - 12:37
Good Afternoon

I have called a JSON Result with an array of vallues:

{"User_Details":{"columns":["ID","Name","Surname","Email"],"records":[[1,"Name1","Surname1","mail1@email.com"],[3,"Name2","Surname2","Mail2@email.com.com"]]}}


When it's a single value it's easy to add to my fields because the structure of the json is simple and I can get the values direct:

{"ID":1,"Name":"Name1","Surname":"Surname1","Email":"mail1@email.com"}


I cannot get the multiple result to my table - I have created a structure:

STMyRecords is structure
ID is int
Name is string
Surname is string
Email is string
END


STUserDetails is structure
arrRecords is array of string
END


And this is my code:

myrequest is string
bufBuf is Buffer

stMyDetails is STUserDetails

myrequest = HTTPRequest("https://getthejasonresponsehere/")

bufBuf = HTTPGetResult()

Deserialize(stMyDetails,bufBuf,psdJSON)


I have tried so many scenarios and don't know where to go with this. I am using Windev Mobile 21 so there is no JSONtoVariant option.

Please can someone help me with the code.

Regards

Ruan