PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2025 → Windev 24 Json
Windev 24 Json
Iniciado por quentinbihan, 27,mar. 2019 16:06 - 1 respuesta
Publicado el 27,marzo 2019 - 16:06
Bonjour à tous,
j'ai un fichier test.json qui est valide et j'aimerais afficher certaines données ça à l'air super simple mais je bloque totalement ..
mon fichier test.json
{
"Voiture": [
{
"id": 1,
"typeVehicule": "Voiture rouge)",
"Transport": "AB"
},
{
"id": 2,
"typeVehicule": "Voiture bleu)",
"Transport": "C"
}
]
}


j'importe mon test.json dans windev et je le dragNdrop il me créé la ligne ci dessous

TESTjson est un JSON, Description="test"

LIB_description = TESTjson.Voiture[2].typeVehicule // il m'affiche 0

le même fichier test.json en PHP je fais
$TESTjson = $parsed_json->{'Voiture'}[2]->{'typeVehicule'};
echo $TESTjson; // et il sort bien Voiture bleu

Voila je voudrais simplement afficher les valeurs dans un champs (j'ai testé beaucoup de variante mais j'ai toujours comme réponse 0 ou NULL)
C'est surement super simple mais je sèche complètement
Merci d'avance à tous
Publicado el 27,marzo 2019 - 17:29
Sans doute parce que vous n'affectez rien à votre variable JSON
Il manque
TestJSON = <chaine au format JSON>