+1
Résolu

How to access json datasource from a sub wire

sstava il y a 11 ans mis à jour par icahill (Administrator) il y a 11 ans 4
Project: 7358

I am interested in sharing a json datasource with a subwire. I am able to get to a standard variable that is in the main.wire from the sub.wire.

I can't figure out how to get access to a json datasource that is in the main.wire, from the sub.wire.

any thoughts?
Steve,

Let me take a look at the WIRE and I will get back to you.
Steve,

Unfortunately this method is not currently possible with WIRE. Because your json feed is being created on the fly for main.wire, it can't span over to another wire file. This has more to do with the way the json is stored in the system than it does the targeting of say something like a variable.

If your json were external than obviously you could access it in both.
Thanks for the quick response!

I'm looking for a good way to compartmentalize the data that will be used for each of the wires.

I guess I could write a json blob to a SQLite table on the main wire side and then pick it up in the sub wire?

I could use a variable on the main wire side that would contain the unique key to be used to do the query in the sub wire.

What do you typically do?
It seems like generally we create either an app as a single wire file that can take advantage of the same data or use more than one datasource.

res SQL is a good way to get reuse, but it will perform slower than json.