Lua Script in data to server section

I still can’t get it to work. Let me show the details of what I am doing:

  1. I have a Modbus client reading succesfully. It has a variable named “Corriente”, as you can see in the picture.

  2. I created a Data to Server instance with a Lua script format type with the following very simple code trying to read “Corriente” tag and formating it with my own JSON:

function handle_format_request(data)
local tag1 = tonumber(data[“Corriente”]) or 0
return string.format(‘{ “sum”: %d }’, tag1)
end

  1. It looks like the code is not catching the value of “Corriente” from the tonumber(data[“Corriente”]) because in the MQTT broker shows the value of zero (0)

  2. Whats missing? Does Teltonika have a complete and detailed LUA scripting guide for accessing and managing all this internal data?