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

Amit Verma
Kilo Patron
Kilo Patron

Hi @jasonkist 

 

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

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

View solution in original post

2 REPLIES 2

Amit Verma
Kilo Patron
Kilo Patron

Hi @jasonkist 

 

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

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

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