Retrieve All keys from KeyValue Map in a javascript policy

Hi,

I have a KeyValueMap created at Environment Level.

how can i retrieve all the key/value pairs from the KVM in a javaScript policy?

It's possible?

Thanks in advance

0 2 121
2 REPLIES 2

Hello,

In order to get your KVM value from a key and use it in a JavaScript policy you'll first need to utilize a KeyValueMapOperations policy. Then you'll be able to access the variable in JavaScript. Examples of this solution have already been posted in this community here here

If the structure of your KVM is subject to change and you want to list all keys/values within it then you may need to store your data in a single entry represented by a JSON object. An example of this solution has also already been posted here.