How to decrypt and pass a credential value in custom node

In my custom node, I fetch the username and password which I have to pass to a function of node-ansible npm package to initiate an ansible playbook.

Since I have stored the password under credentials, a value required: true is getting passed instead of the actual password.

Is there any way I can pass the decrypted value of the password?

It was a silly error on my end.

At first, I had given a value to the password field.

While testing the node I cut-pasted the values from the password text field. So then the value of the text field changed to required: true (I guess because it was under credential) and as I was using the same instance of the node I didn't realise that such a thing could happen.

Got to know about it from reading this:

The required: true is a display feature in the Node-RED editor and is not part of the actual credential value. When a value is pasted into the credential field, Node-RED sets required: true to indicate that a value has been set for the field, even though it is not visible. This is just a visual indication that the field has value and it does not affect the functionality or security of the credential.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.