Skip to content

OutputExpressionAction always throws “Expression is missing an 'as' clause” when returning an object #711

@InsiyaNeo

Description

@InsiyaNeo

I’m trying to return an object in my OnSuccess action, but I keep getting this error:

Exception while executing OutputExpressionAction: Expression is missing an 'as' clause

Example JSON:

{
"WorkflowName": "Percent",
"Rules": [
{
"RuleName": "Percent",
"Expression": "true",
"RuleExpressionType": "LambdaExpression",
"Properties": { "DbFactor": 1.25 },
"Actions": {
"OnSuccess": {
"Name": "OutputExpression",
"Context": {
"Expression": "new { State = input.state, CalculatedValue = input.currentLimit * (input.lastYrPrem - 1) * Convert.ToDouble(Properties["DbFactor"]) } as Result",
"Output": "Result"
}
},
"OnFailure": {
"Name": "OutputExpression",
"Context": {
"Expression": "-1 as Result",
"Output": "Result"
}
}
}
}
]
}

Expected: Return an object with State and CalculatedValue
Actual: Engine throws the "missing 'as' clause" error.

Could you clarify the correct format for returning objects in OnSuccess?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions