Skip to main content
1-Visitor
March 31, 2016
Solved

How to set an attribute with type PASSWORD ?

  • March 31, 2016
  • 1 reply
  • 2982 views

Hi All,

I'm trying to set in a JS service the value of an attribute with basetype PASSWORD but I can't find how to do it. Any idea ?

Thanks a lot,

       Seb

To reproduce :

On a thing create an attribute 'password' with type PASSWORD

In a service add : me.password= '1234';

=> : 'Unable To Convert From java.lang.String to PASSWORD'


Best answer by PaiChung

Try using the following

var params = {

  data: undefined /* STRING */

};

// result: STRING

var result = Resources["EncryptionServices"].EncryptPropertyValue(params);

and then use the result to set the Property value.

1 reply

PaiChung22-Sapphire IAnswer
22-Sapphire I
March 31, 2016

Try using the following

var params = {

  data: undefined /* STRING */

};

// result: STRING

var result = Resources["EncryptionServices"].EncryptPropertyValue(params);

and then use the result to set the Property value.

1-Visitor
April 1, 2016

It works perfectly ! Thanks a lot.

       Seb