# Lambda functions not executing from a rule and null reported in log

**URL:** <https://community.openhab.org/t/lambda-functions-not-executing-from-a-rule-and-null-reported-in-log/91887>\
**Category:** Scripts & Rules\
**Tags:** lambda, rules\
**Created:** [February 1, 2020, 8:55pm UTC](https://community.openhab.org/t/lambda-functions-not-executing-from-a-rule-and-null-reported-in-log/91887 "2020-02-01T20:55:28Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [February 1, 2020, 10:01pm UTC](https://community.openhab.org/t/lambda-functions-not-executing-from-a-rule-and-null-reported-in-log/91887/4 "2020-02-01T22:01:31Z")

</div>

Oh …

> [@slefevre](#):
>
> val lambda2 = [ GenericItem sensorX, GenericItem switchX |

from memory, you need to give the return type(?) too e.g. “three entries” for a two parameter lambda. Look into that.

EDIT it’s more complicated than that. See here for description of “auto procedure or function” action

> [@Reusable Functions: A simple lambda example with copious notes](https://community.openhab.org/t/reusable-functions-a-simple-lambda-example-with-copious-notes/15888):
>
> Major Edit: Rewrote with the cleaner OH 2.3 syntax. The example lambda on the OH 1 wiki is overly complex and as written will not work in OH 2. This quick example will show a super simple lambda example with copious notes. Here is the code without comments. It takes in an Item, logs it’s state and returns a slightly modified version of the String logged. val log= [GenericItem s | logInfo("lambda", s.state.toString) s.state.toString + " logged"] rule "Call Lambda" when // some t…

---

_[View the full topic](https://community.openhab.org/t/lambda-functions-not-executing-from-a-rule-and-null-reported-in-log/91887)._
