Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions JSON Data expression problem

  • JSON Data expression problem

    Posted by Javier Rodriguez on November 9, 2018 at 6:03 pm

    Hi,

    I’m trying to start the data graph / json tutorial. The original expression to get the country name is this:

    eval(“var x=” + footage(“csvjson.json”).sourceText);
    x[0].name;

    The problem is that i can’t get the “name” thing because in my JSON file their name goes like this:

    “Country Name”: “Mexico”,
    “Country Code”: “MEX”,
    “Series Name”: “GDP (current US$)”,

    If i type “Country Name” I get the expression error.

    How can I get this data witout changing all the names in my file.

    * Same thing with these:

    “1968 [YR1968]”: 29360000000,
    “1969 [YR1969]”: 32480000000,
    “1970 [YR1970]”: 35520000000,
    “1971 [YR1971]”: 39200000000,

    Scott Mcgee replied 7 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Scott Mcgee

    November 12, 2018 at 12:28 pm

    Json is funny about spaces.

    I would write it like this personally.

    txt = footage(“Country.json”).sourceData;
    txt[“Country Name”]

    The above then allows for spaces.

    Normally if you didn’t have spaces in Country Name like this (Country Name), it would look like this.

    txt = footage(“Country.json”).sourceData;
    txt.CountryName

    Hopefully that helps

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy