Q:

TFS Widget - how to save value properly for multiple widgets?

I would like to know, how to save data from widget code (not configuration).
My goal is to remember some value and show an arrow (up: current value is higher than previous, down: it is lower than previous).
I'm loading data with ExtensionDataService:
// Get the data service
VSS.getService(VSS.ServiceIds.ExtensionData).then(function(dataService) {
    // Load previous values
    dataService.getValue("PrevValues", {scopeType: "Default", scopeValue: "Current", defaultValue: ""}).then(function(value) {
        PreviousValues = value;
        //  do some calculations
    });
});

And after calculations, I'm saving data:
// Get the data service
VSS.getService(VSS.ServiceIds.ExtensionData).then(function(dataService) {
    // Save previous values
    dataService.setValue("PrevValues", PreviousValues, {scopeType: "Default", scopeValue: "Current"}).then(function(value) {
    });
});

Let's say the widget is called DoMyOwnCalculations
The problem is, that I have 2 (or more) widgets DoMyOwnCalculations on dashboard. Each of them is doing some calculations based on configuration and each of them should remember it's own result.
With the solution presented above, I'm always getting the same data.
An quick example:
First widget saved "1" as a result, second saved "2".
After this, when reading the value I always get "2".
Is it possible to store data with the same key ("PrevValues"), but separately for each widget placed on dashboard?
Thank you in advance
Slawek

A:

No, it's impossible, as the key ("PrevValues") always point to the same value.

