retreive data from json - Forum

Forum Navigation
You need to log in to create posts and topics.

retreive data from json

Hi Luis,

I created a file with neoLocalStorage, saved as a json.
{"Objet":"ECRAN","Emprunteur":"Marc","Date":"Mercredi 17 Février 2021"}

---------------------------------------------------------------------------------------
.. Création fichier json
CreateEmptyObject [monObjet]
SetVar [monObjet('Objet')] [objetChoisi]
SetVar [monObjet('Emprunteur')] [emprunteurChoisi]
SetVar [monObjet('Date')] [dateChoisie]

.. Storage du fichier
neoSetItem "[objetChoisi]" [monObjet] ""
---------------------------------------------------------------------------------------- This works.

Now I want to access the data that are in this file
----------------------------------------------------------------------------------------

neoGetItem "[objetSelection]" [fichierlu] ""
.. [objetSelection] is a variable from a ListBox where I store files names (using neoGetItemsNames )

So I have : [fichierlu] = {"Objet":"ECRAN","Emprunteur":"Marc","Date":"Mercredi 17 Février 2021"}

I tried this, but it seems not to works...

----------------------------------------------------------------------------------------
SetVar [var1] [fichierlu ('Objet')]
SetVar [var2] [fichierlu ('Emprunteur')]
SetVar [var3] [fichierlu ('Date')]

What am I doing wrong ?

...Finally I found that a 'WAIT' was necessary...

Now it is OK! :)