Querying encrypted field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2022 09:32 AM
Is there a way to query encrypted field through glide record? I am trying to query using gliderecord with a value but doesn't work. Is there any way to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2022 10:19 AM
Did you try to encrypt the data to use in the query first:
var gc = global.GlideCryptoModule.getModule('global.acme_mod');
var value = 'test';
var encrypted = gc.encryptData(value);
gs.info('value: ' + value);
gs.info('Encrypted: ' + encrypted);
var decrypted = gc.decryptData(encrypted);
gs.info('Decrypted: ' + decrypted);
gs.info(decrypted == value);
Aoife
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2022 12:25 PM
I tried it but no luck, don't see anything in the logs printed..This is a scoped application so wondering if it doesnt worked for scoped apps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2022 01:05 PM
I would think it would have to work in a scoped application, not sure why it wouldn't. Need encryption in scoped apps too. There might be a scoped version of it, would have to search the API docs.
Here's another encryption API that works in scoped apps:
var e = new global.Encrypter("abcdefghijklmnopqrstuvwx");
var secret = e.encrypt("test");
gs.info(secret); // => Zjem9344FZk=
gs.info(e.decrypt(secret)); // => test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2022 10:26 AM
Hi @samadam ,
Please refer below support article :-
Unable to see encrypted field information even though user has encrypted context