We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

GlideElement getDecryptedValue

jasonkist
Giga Guru

Hey All, with GlideEncrypter being deprecated and recommended to discontinue use after2023, we are trying to switch over to Glide Element getDecryptedValue(). The examples given are to here say to use a gliderecord and decrypt from a password field. Problem is, all our password2 values are in sys_properties and the provided example doesn't work in link above. Consider following example(my test was run in a widget hence using addInfoMessage):

 

    testGlideElement: function(){
        var pass = new GlideRecord('sys_properties');
        pass.addQuery('name','example_pw2_value');
        pass.query();
        if(pass.next()){
            gs.addInfoMessage("value: " + pass.getValue('value'));
            gs.addInfoMessage("decrypted Value: " + pass.value.getDecryptedValue());
        }
    },
 
Anyone have ideas?
1 ACCEPTED SOLUTION

vermaamit16
Kilo Patron

Hi @jasonkist 

 

Can you try to use gs.getProperty('name of your Password 2 type system property') ?

 

Thanks & Regards

Amit Verma

Thanks and Regards
Amit Verma

View solution in original post

2 REPLIES 2

vermaamit16
Kilo Patron

Hi @jasonkist 

 

Can you try to use gs.getProperty('name of your Password 2 type system property') ?

 

Thanks & Regards

Amit Verma

Thanks and Regards
Amit Verma

I must admit I was skeptical but this is it. Had no idea it was that simple. Thank you so much.