Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Refer to JSON data by index AND attribute name

  • Refer to JSON data by index AND attribute name

    Posted by Jon Smith on August 20, 2019 at 6:36 pm

    Hey all, I’m trying to work with JSON data and referring to the data by both index and attribute name. I tried a couple different methods but I’m not able to get it to work. I’m guessing it’s a syntax thing but I’m not sure. Any help is appreciated!

    Example JSON:
    {
    “item1”: {
    “name”: “Item 1 Name”,
    “parameter”: “Item 1 parameter”,
    },
    “item2”: {
    “name”: “Item 2 Name”,
    “parameter”: “Item 2 parameter”,
    },
    “item3”: {
    “name”: “Item 3 Name”,
    “parameter”: “Item 3 parameter”,
    }
    }

    expression method #1
    myData = eval(footage(“sample.json”).sourceData);
    myData.item1.name; // works
    myData[0].name; //doesn’t work

    expression method #2
    footage(“sample.json”).dataValue([0, 0]); //works
    footage(“sample.json”).dataValue([0, name]); //doesn’t work

    Tomas Bumbulevičius replied 6 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies

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