KeyValueMap Operations - GET not working 2

i’ve created keymap named Credentials with 2 key/values:

username user password 1234

and the following policy does not read it:

	<KeyValueMapOperations name="getPassword" mapIdentifier="Credentials">
	   <Get assignTo="my_password" index="1">
	      <Key>
	        <Parameter ref="password"/>
	      </Key>
	  </Get>
	</KeyValueMapOperations>

i’m expecting new variable my_password is set to the value ‘1234’

but it remains empty.

what I’m doing wrong?

Hi Dmitry Lukyanov,

Can you please try the below and let me know if it works.

password, as “password” is the key name.

ref is used when we are referencing any variable. Is password a variable here?

Also you can check the scope here. If the scope used while creating the entry is same while retrieving the entry.

1 Like

to fully elaborate on the ref which can be really confusing, the idea is that the name or the string referencing the name is contained in a variable versus when in the tag it is using the string contained within the tag

Thanks.

The code snippet and the documentation for KeyValueMapOperations are really confusing…

Thanks.

The code snippet and the documentation for KeyValueMapOperations are really confusing…