-
Notifications
You must be signed in to change notification settings - Fork 24
Eval
Miriam McMahon edited this page Apr 27, 2023
·
7 revisions
A logic component that can be used to evaluate or execute an in-line expression. The expression can be any valid C# inline expression see Variable Reference for details
Parameter Name | Description | Type | Resolved Type | Required |
---|---|---|---|---|
Expression | The expression to evaluate. The %{}% markers are not required since this can only accept an expression. | Value | n/a | Yes |
Example: add an object to a list of discovered groups
{
"SetItem": {
"Name": "GroupList",
"Value": "%{new List<DiscoverGroup>();}%"
}
},
{
"Eval": {
"Expression": "GroupList.Add(new DiscoverGroup{Name=GroupName, Id=GroupId})"
}
}
Example: create a complex object, and use eval to update the properties of the object
{
"SetItem": {
"Name": "MyObject",
"Value": {
"Name": null,
"Age": 0,
"Email": null
}
}
},
{
"Eval": {
"Expression": "MyObject.Name = \"jane doe\""
}
},
{
"Eval": {
"Expression": "MyObject.Age = 20"
}
},
{
"Eval": {
"Expression": "MyObject.Email = \"[email protected]\""
}
}