GlideEncrypter API is deprecated, GlideElement API is suggested for encryption using setDisplayValue

abhiax2727
Tera Contributor

Hi All,

 

GlideEncrypter API is deprecated, GlideElement API is suggested for encryption using setDisplayValue() method.
I am not able to achieve the result using the same API and method.

Ca someone help how we can encrypt the data using this API, or if there is any other alternative.

Please hep with the piece of code 

7 REPLIES 7

Well that's half your issue, why are you storing an encrypted value in a nom-encrypted field?

 

What are you trying to achieve?

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

This might help you:
- 2024-01-15 - Article - GlideEncrypter API not permitted beginning with the Xanadu release 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

daisybora
Tera Contributor

Hi @abhiax2727 ,

Were you able to resolve you issue. I have an existing piece of code like the below where the encrypted string is being used in a workflow scratchpad, and needs to be updated. Do you have any suggestions on an alternative?

 

var clearString = 'abcd';
var encr = new GlideEncrypter();
var encrString = encr.encrypt(clearString);
workflow.scratchpad.encr = encrString;