Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Please help..., Failed to parse JSON file, must begin with....

Author
Message
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 27th Sep 2020 13:51
Hi Guys

Please help me out on this. For some stupid.. brain freeze, I cant get this error sorted with loading a JSON file using .fromJson

I kindoff understand the Json Structure.... but never done it in AppGameKit to load in agk and use from there with arrays etc...

IS THERE ANY TUTORIALS/DOCUMENTATION FOR THE "HOW TO" OF JSON AND AppGameKit??? except the arrays page?







Any help appreciated

Thanks

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Sep 2020 22:00 Edited at: 28th Sep 2020 02:45
Run this code and it will create a file;
C:\Users\your_id\AppData\Local\AGKApps\your_app\media\student.json

Use that file as a guide for creating your json file






***EDIT***
I changed the code to add a couple of entries to show how the array is formatted so
This code


Produces this JSON file


DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 28th Sep 2020 05:16
Thanks BlinkOk, life saver as always.

I see how this creates an export json file from my arrays.
But somehow I cant get it exported the same format as my json file that needs to be imported
I've re-read this documents, but somehow the arrays got me completely confused now

And I keep breaking your code with my "stupidity" to try figure out the object/arrays/elements

Cant get the output to look like this, so clearly the way I do array/objects is wrong






blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Sep 2020 05:47
Where did you get that json file from?
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 28th Sep 2020 06:15
It's a File created by our school management software (3rd party Company),
which give me an auth_token and with API I I can query, and get a JSON file output.

I need to import the json file into my "agk" app, and manupilate/send the data to various app's in "NON JSON format".

I can't take 3 days to figure out something like this... really make me mad like hell and quite irritated,
Dunno why I always try to come back to AppGameKit to do thngs....

Strange there is NO decent documentation about the JSON stuff

Thanks for the help BlinkOk





blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Sep 2020 06:32 Edited at: 28th Sep 2020 06:33
If you want to message me the json file i can format it for you
Alternatively you could parse it yourself. it seems like it's very straight forward
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 28th Sep 2020 07:08
Thanks, I'll PM you, appreciate... I'm pretty sure I just overlook something, somewhere
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Sep 2020 09:45
ok. i fixed it. Check your messages
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 29th Sep 2020 13:32
Thanks BlinkOk

Your solution works perfect.

Really appreciate your time and help to find a solution to with this problem.

Cherio

Login to post a reply

Server time is: 2024-04-16 11:03:13
Your offset time is: 2024-04-16 11:03:13