Increment a state variable in payload format Converter

Hi guys,
I’ve need a increment variable in function Convert(decoded, port), is possible?
Actually at every access is resetting…

Thanks a lot
Stefano

Not possible; you only get the decoded application payload and the port number, and cannot preserve any state. It’s also not possible in the Decoder function.

See also:

So, you’ll need to keep state on your application server, or use some third-party server. For Node-RED see Working with context. For Pipedream, see $checkpoint in Workflow state.

And beware: