Can you use data from the device bucket in the decoder?


I need to compare the value of a variable sent by the device with the previous one in the bucket, I currently do that by an action triggering an analysis. In the interest of saving time and/or space, is it possible to do this in the decoder by accessing data from the bucket?

Also currently I have many devices that perform a similar function and I use 1 action and 1 analysis per device to check this. Is it possible to get the device token in the code instead of as an environment variable so that I can have 1 action and 1 analysis for all the devices?

Thanks in advance for your help.

Hi @ovalknight ,
The payload parser doesn’t allow async requests, and can’t perform data operations. If you need to get an data from the device, you will need to use analysis instead.

About getting the token automatically through the analysis, check this topic: operateData - device_token of device which received the last data - Analysis - TagoIO Community

Alright, thanks @vitor for you help.