Decrypting Masked Catalog Item Variable in Flow, Utah

Mikael Karlsson
Kilo Sage

Hi, we'd like to capture a Masked variable in a catalog item, then use that variable inside a flow as decrypted.
We've tried the various options seen on the internet but with no luck.

For example GlideEncrypter produces a small B64 encoded encrypted string: 0RGmUyTcnMQ= But the Masked Field variable raw value looks more like this:
$$%%anv:kojRf24tp7r2QVQgCLm5o+2Uf0B1czD3A9izvj8x2QA=%%$$
and GlideEncrypter cannot decrypt this and instead returns the same string.

1 REPLY 1

Scott_Groth_BAH
Tera Contributor

Check out the linked support article.  It almost worked for me.  In my case I was using a "Get Catalog Variables" action.  The problem is the outputs are all strings.

I was able to do a GlideRecord request for the RITM.  At that point, you can use the getDecryptedValue() method to get the plain text version of the variable.

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0681163

 

Example:

var gr = new GlideRecord('sc_req_item');

gr.get('<sys_id>');

var plain_text_var = gr.variables.masked_variable.getDecryptedValue();