Storing/managing JSON object


Is there a way to store and manage a JSON object within InsightConnect?
I saw that the Storage plugin has been superseded by the Global Artifact & Custom Loop Variable feature.

I noticed that the Global Artifact only supports the Array data type.
But with the helpers I can only lookup and add new entries to the Artifact.

In my use case I’m working on a workflow that daily queries metrics from a third-party endpoint.
Within InsightConnect I was hoping to only keep track of the overal highest metric values.
So that I can show at the end of the month what those highest values are and possibly reset the values from the variable.

That’s interesting…So to start off, we’re not removing the Storage plugin, just not supporting it any more. So if it’s working for you, you can stick with it.

As for managing individual metrics. How many are we talking about? If it’s under, say, 5, you could create a global artifact for each and save a single value in each array and use those for rollups. Or you could append each daily number to the array and do an end of month WF to do analysis on those.

We’re also talking this over internally. Can you give us more information about you use case? How big are the JSON objects you’re dealing with, and how many metrics are we talking about?

Something else that might come in handy is we have this.

Thanks Joey,

I already saw the jsonedit plugin and that could indeed be handy to manipulate a JSON object in a WF.
From what I have seen I can’t directly edit/remove a value from the Global Artifact with a Helper in the WF. Appending values to a Global Artifact could work with a little effort.
But doesn’t this mean that I have to clean up the artifact from time to time?

The metric itself is just single integer. The JSON that I have in mind is actually a nested one, where I define for each ID a single name and a value.
“1234” : {
“Name” : “Name”,
“Metric” : 5

But I could also ommit the nested object and turn in more into this:
“1234” : 5,
“1235” : 3
Currently I have 20 keys, but it could grow over time.
As for my use case, I want to lookup the metric for each ID, if it’s larger than noted in my json variable, then I want to change it’s value. At the end of the month I want to send an email with the highest metrics.

Stick with Storage for this for now. However, a strong word of caution…Storage will wipe your data unpredictably at times. If the container is blown away and restarted, it takes its cache with it.

A lot of what you’re asking for is on our roadmap as new features, but we aren’t there yet. We’re shooting for the first quarter to get a lot of this done.

Something to consider…could you use Google Sheets or CSV and FTP to save this information to a file somewhere? It’s not fun to convert JSON to a DB format, but it would be safer than Storage for persistent data.

1 Like