Jump to content

Array help


Plucky

This topic is 1281 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi

Im just started to implement some javascript charts into my Filemaker db and I've run into an issue with an array. My loader script creates the 3 x variables. The $sales variable looks like it's working for each individual record as it loops through ( {"month":December","sales":"777"} but the $data variable cannot create the Array. It displays in the debugger as [[],[],[],[],[],[],[],[],[],[],[],[]]. I think it should look like this: [{"month":December","sales":"777"},{"month":November","sales":"256"}].

Any help on this would be much appreciated as I'm pulling my hair out..

Screenshot 2020-10-16 at 09.43.29.png

Graph.fmp12

Link to comment
Share on other sites

I only glanced at this, but I believe that instead of:

JSONSetElement ( $data 
; [ $counter ; $sales ; JSONArray ]
 )

you should have:

JSONSetElement ( $data ; $counter ; $sales ; JSONObject )

 

--
I am not sure if it makes a difference, but it seems to me that "sales" should be set as JSONNumber, rather than JSONString.

  • Like 1
Link to comment
Share on other sites

This topic is 1281 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.