Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions AE unable to read data from an external JSON file using .sourceData

  • AE unable to read data from an external JSON file using .sourceData

    Posted by Aoife Mccarthy on June 17, 2020 at 2:24 pm

    Hi all – I’m trying to create a data-driven animation in AE, but am having issues using the .sourceData attribute to read the data from my JSON file (the very first step, argh!).

    I’m trying to use values from the JSON to set the size property of an ellipse path.

    When I start my expression off with this line:

    myData = footage("impact_scores.json").sourceData;

    I get this error message:

    I can’t see that there’s anything wrong with my JSON (it’s just a simple array of objects – 14186_impactscores.json.zip), and I can’t seem to find anybody online having the same issue.

    Has anybody experienced this problem before or have any ideas on how to troubleshoot? I’ve tried both expressions engines (javascript and legacy – with legacy the error message is ‘Object of type Object found where a Number, Array, or Property is needed’), and I’ve tested a bunch of different JSONs with the same result.

    Here’s the expression I want to write once I can get the JSON to link:

    myData = footage("impact_scores.json").sourceData;

    val = myData[1].01_01_2020

    [val,val]

    …and I’ve just updated my AE, so am running version 17.1.1.

    Any help would be greatly appreciated!

    Aoife Mccarthy replied 5 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    June 17, 2020 at 5:26 pm

    I can get your expression to work with your data file, but I have to change the names of data fields so that they start with a letter. For example:

    “01_01_2020”: 0,

    doesn’t work, but

    “X01_01_2020”: 0,

    does.

    Dan

  • Aoife Mccarthy

    June 17, 2020 at 7:20 pm

    Hi Dan, thank you so much – problem solved! Funnily enough my developer friend had suggested this to me earlier, but I must have made some other error whilst I was trying it out the first time as it didn’t work.

    Thanks again!

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