EnterpriseVariable.GetVariableValue
Description
Retrieves the value of the specified Enterprise Variable from the connected AI Command Center
Signature [C#]
Task<EnterpriseVariable> GetVariableValue(string propertyName, string key);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
propertyName | string | Required | Specify the name of the enterprise variable to be retrieved. |
key | string | Required | [for future usage] |
Output
| Property | Description |
|---|---|
| Task<EnterpriseVariable> | Returns the specified enterprise variable. |
Remarks
Use GetVariableValue API to get the enterprise variable value from the connected AI Command Center.
Example
C#
public async Task GetEnterpriseVariableValue()
{
IControlRoomContext context = LoginControlRoom();
try
{
string propertyName = "TestEvar03";
string key = null;
EnterpriseVariable enterpriseVariable = await context.EnterpriseVariables.GetVariableValue(propertyName, key);
Console.WriteLine("EnterpriseVariable Name: " + enterpriseVariable.Name);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}
See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.