Ubidots Community

[SOLVED] Ubidots App Inventor Json decoding

Hi, i use App Inventor for read variables (when press a button). I have use KIO4DecoJson extension.
I have problem for get data (i do not know give the correct path), Help!

I would get value in last_vale array.

Good day @bulkintech

We’re glad to see you around the community! Thank you for sharing your question with us.

Although we are not an Inventor experts, checking your code we saw a couple of changes that must be done to retrieve the Ubidots data:

  1. The query param fields is only available in the version 2.0 of our API, therefore, you must change the endpoint to https://industrial.api.ubidots.com/api/v2.0/devices/ <device_key> /. Note that you must use the path /devices instead of /datasource.

  2. To retrieve the last value of each variable you must use the keys ["results"][index]["last_value"]. Bear in mind that the index is for each of the variables of the device, if you want to retrieve all of them, you would need to use a for loop.

Please try these and tell us if you were able to retrieve the data. Otherwise, please let us know to help you find more solutions.

All the best,

Thanks at lot

1 Like