RulesEngine icon indicating copy to clipboard operation
RulesEngine copied to clipboard

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

Open InsiyaNeo opened this issue 1 month ago • 0 comments

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?

InsiyaNeo avatar Nov 14 '25 18:11 InsiyaNeo