Datastore from PHP include file and run its methods from JS?

Hey guys.

Is it posible to call the datastore component methods directly from js?

I need to set some data from inside a script tag but dmx.app.data.datastore.function() doesn’t seem to work. I am assuming it’s because it’s a private method.

Also this datastore is created inside a php include file. Don’t know if this is the problem.

Hey @JonL

Are you talking about adding to a datastore key from js? I tried this within a script and it works,

localStorage.setItem("datastore_maxTest", Date.now());
1 Like

Yes, but using AC native functions.

1 Like

I think we need to wait for Sir Patrick to reply :wink:

Have you tried using dmx.parse?

dmx.parse("datastore1.insert(" + jsValue + ")");
3 Likes

Thanks Ken! That did the trick!

2 Likes