- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 10:55 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 09:20 PM
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));
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 03:14 PM - edited 03-20-2025 03:18 PM
You definitely don't want this line
var encoded = value.substring(this.compressed_header.length, value.length);
and the rest can be condensed into a single line like this
String(GlideCompressionUtil.expandToString(GlideStringUtil.base64DecodeAsBytes(compressedValue)));
or alternatively like this
String(GlideCompressionUtil.expandToString(GlideStringUtil.base64DecodeAsBytes(gr.values)));
where gr is the sys_hub_action_instance_v2 record you want to decode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 07:40 PM - edited 03-20-2025 04:21 PM
For anyone that would like to decode/decompress client-side you can put this into a browser bookmarklet. Click on it when you have the sys_hub_action_instance_v2 record open. This also works as a custom SN Utils slash command. (btw the JSON viewer in Firefox is 10x better than the one in Chrome). To make this code a bookmarklet (or an SN Utils command) you need to prefix it with "javascript" and ":"
Which I can not type in the box below as this editor messes with the combination of "javascript" and ":" just like this "javascript:"
So use ":" and not ":"
(async () => window.open(URL.createObjectURL(new Blob([await new Response(new Blob([Uint8Array.from(atob((window.gsft_main ? gsft_main.g_form : g_form).getValue("values")), c => c.charCodeAt(0)).buffer]).stream().pipeThrough(new DecompressionStream("gzip"))).blob()], {type:"application/json"}))))();