Hi Reiner,
Thank you very much for your reply - I will cancel my support ticket.
In answer to your question about having a need for JSONs as variables:
Admittedly I have been using Design Studio for some time now without it or feeling the need for it.
That said, I do think it would be incredibly useful if it were a supported feature. JSONs (and arrays of JSONs) are far more flexible than simple arrays for many tasks (particularly if certain JavaScript methods for accessing JSON properties are available to the designer). A couple of examples:
1) Array of JSON example - a simple lookup table:
var myPrice = 24.99;
var myJSONArray = [{"priceBarrier": 10.0, "category":"Low Cost Item", "color":"green"},
{"priceBarrier": 20.0, "category":"Medium Cost Item", "color":"yellow"},
{"priceBarrier": 30.0, "category":"High Cost Item", "color":"orange"},
{"priceBarrier": 40.0, "category":"Very High Cost Item", "color":"red"}]
With the above structure you could take myPrice (say, 24.99), loop through the Array of JSONs to find the first entry (since an array is an ordered list) where myJSONArray[index]["priceBarrier"] <= myPrice.
This is a trivial example which could be handled by several arrays - but having several arrays means having several loops, whereas the above could be handled with a single loop (provided BIAL allows such looping and access to JSON values).
2) Customer detail object:
I have a application where I want to see the detail of that customer (name, address, last 5 purchases, at risk of churn, etc.), along with trends/analytics for similar customers.
The detail of the customer is "for information" only - its only purpose is to provide context to the trends/analytics for similar customers. An example JSON for the customer details could be:
{
"customerId":1234,
"firstName":"Bob",
"lastName":"Example",
"address":{"line1":"1 Example Street",
"City":"Exampleville",
"PostCode":"212-ACDC",
"Country":"Exampalia",
"geoLat":"83.11232",
"goeLong":"78.88979"
}
"customerProfileKey":"asd-0012-elec-hv-8908",
"customerValue":"High",
"churnRisk":"Very High",
"lastFivePurchases":[{"purchaseId":12321, "purchaseDate":"2014-11-23", "purchaseItem":"Big Screen TV", "purchaseValue":1200.00},
{"purchaseId":11210, "purchaseDate":"2014-06-12", "purchaseItem":"Power Board", "purchaseValue":35.99},
{"purchaseId":12321, "purchaseDate":"2014-06-11", "purchaseItem":"Gaming Console", "purchaseValue":399.95}]
}
If Design Studio supported JSON variables/objects by provided methods to interact with them then I perhaps do the following:
a) In the warehouse, store the customer details JSON in a column in a customer dimension table (note that the JSON object is not massive, but is hierarchical and nested).
b) Retrieve this JSON via a DSL data source for several customers (Noting there may be a problem if the size of the JSON is above a certain limit - but I have had success returning UNX Long Text measures in a DS data source (admittedly there are tricks to it)).
c) For the first customer to be displayed, iterate through the customer detail JSON to populate a "Customer Information" area (since I know the JSON's schema, a full text view would work nicely here). I could also use the geoMaps component to show the customer's location.
b) Use some of the details returned in the customer detail ("customerProfileKey") to run other more "traditional" data source for trends/analytics.
I know this example is somewhat trivial as many of the customer details I have included in the JSON example could simply be returned as dimensions in a data source; however I'm hoping it gives an idea of the kind of thing I could see being achieved with it.
Sorry for the lengthy response!
Thanks Pat
Message was edited by: Patrick Godwin