Don't see reason to have this `if...else`. It would be just enough to use: `firstRecordExpression.getValue(evaluationContext, requestMessage, Number.class)`