Articy Forum


https://www.articy.com:443/forum/

How to change GlobalVariable? How to check if variable exist

https://www.articy.com:443/forum/viewtopic.php?f=47&t=18976

Page 1 of 1

How to change GlobalVariable? How to check if variable exist

Posted: Thu 12. Sep 2019, 08:58
by andrey_st
var varSet = Session.GetVariableSetByName("UserSettings");
if (varSet == null)
{
varSet = Globals.Session.CreateVariableSet("UserSettings");
}
try
{
Globals.Session.CreateGlobalVariable(paramId, settingsJsonString);
}
catch (Exception)
{
// TRY TO CHANGE
var userVariables = varSet[ObjectPropertyNames.Variables] as IList<ObjectProxy>;
foreach (var userVar in userVariables)
{
if (userVar.GetDisplayName() == Globals.Session.GetCurrentUser().LoginName)
{
// WHAT TO DO ?
}
}
}

All times are UTC
Page 1 of 1