Studio web converting non secure string to secure password credential

I have a table in D365 that is a standard string that I am pulling into studio web, I want to assign it to a secure credential however, I cannot seem to get conversion from standard text to secure string OR password type variables.

This is the syntax I tried (in both a variable type of string, and secure string)
(new System.Net.NetworkCredential(“”, InsuranceCompanyData.new_agentportalpassword)).SecurePassword

Hi @Nathan_Betters1
Standard string to a secure string ,

string standardString = InsuranceCompanyData.new_agentportalpassword;
SecureString secureString = new SecureString();
foreach (char c in standardString)

Then you can use the secureString variable in your NetworkCredential object, like this:

new System.Net.NetworkCredential("", secureString)

Hello @Nathan_Betters1
Try this

For Secure string,To Value should be Secure String Variable type

(new System.Net.NetworkCredential("",YourString )).SecurePassword

To convert Secure string to string use this

(new System.Net.NetworkCredential("",SecureString)).Password

The problem I am running into is with studio web not studio desktop, it does not seem to recognize .securepassword or .securestring or .password


Please check this…It is able to set and it did not throw any error. Can you please try

Variable type is SecureString