I want to use credentials from the library on a script but can't find the credential ID
Hi Daniel,
The easiest approach is to avoid looking up the GUID manually and instead add the credential through the Automation Script Editor in Cube:
- Open the automation script in Cube.
- Navigate to the CREDENTIALS section.
- Click Add and give the credential a name.
- Select the credential type: Username and password or Token.
- Select the appropriate credential from the dropdown.
Cube will automatically store the correct CredentialId GUID in the script XML. Note that the dropdown only displays credentials you have access to.
You can then retrieve the credential in your C# code by its name or local ID:
<code dir="ltr">engine.GetCredential("YourCredentialName");</code>
Or by its local ID:
engine.GetCredential(1);
For more details, see the documentation: Using credentials in an automation script.