Viewing the "Values" field of sys_hub_action_instance_v2

Biz-JoshM
Tera Contributor

We've done some automation where we are evaluating Flows, where we perform an action if any "action" and "inputs" are present.

 

To summarize we used to do this with a mixture of querying the "sys_hub_action_instance" and "sys_variable_value" tables.

 

However, when looking at "sys_hub_action_instance_v2" there is only one field, and it is the "Values" field, which contains what seems to be an encrypted string.

 

What is the best way to programmatically see what actions and values are assigned to a Flow / Subflow taking into consideration Xanadu seems to have introduced a V2 action that uses a different methodology?

1 ACCEPTED SOLUTION

-_MS_-
Tera Expert

Found the answer in the DiffAudit script include.

 

 

 

_decompress: function(value) {
        var encoded = value.substring(this.compressed_header.length, value.length);
        var cs = GlideStringUtil.base64DecodeAsBytes(encoded);
        return String(GlideCompressionUtil.expandToString(cs));
    },

 

View solution in original post

11 REPLIES 11

milesallsmyles
Tera Contributor

im trying to use the value field to cross reference with a database. Can someone  tell me of a way to implement this decoding so i can run reports?

var compressedValue = "{{compressed_string_goes_here}}"; // Replace with your value
gs.info(decompress(compressedValue));

function decompress (value) {
    var encoded = value.substring(this.compressed_header.length, value.length);
    var cs = GlideStringUtil.base64DecodeAsBytes(encoded);
    return String(GlideCompressionUtil.expandToString(cs));
}

 

I would like to mention that we are currently in contact with support about this and they are very hesitant to give us the okay on using this. So much that they actually are still exploring alternatives. I'd use at your own risk. If I get an official response / approval from support I'll reply here!

Okay to use it for what? Support says all kinds of strange things, it really depends on who you are talking to.

Biz-JoshM
Tera Contributor

Simply reading the compressed data programmatically via server-side code. Our support request was very generic, and mentioned how we could do it in pre-Xanadu actions but could not in post-Xanadu actions.

 

We were told it was great we found an answer here, then we were told to hold off on using the provided solution and to open an official support request.

 

What that means? Your guess is as good as mine! It's just important to note that there was some hesitation.

 

Edit: I'll probe further if the official reply from support isn't satisfactory though! 😁

Biz-JoshM
Tera Contributor

FYI! We did get response from support finally, and this was the recommended solution. So my warning can be dismissed!