Skip to content
Miriam McMahon edited this page Apr 27, 2023 · 7 revisions

Description

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

Parameters

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

Examples

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]\""
    }
}