Retrieve 'last' value for a specific field | MATLAB IoT Analytics | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Retrieve 'last' value for a specific field
No permission to create posts
October 13, 2015
8:59 pm
Avatar
AYAduino

Silver
Members
Forum Posts: 9
Member Since:
February 10, 2015
sp_UserOfflineSmall Offline

I need to be able to retrieve the last value written to a specific field along with its timestamp. I have no way of knowing if the field was written to a minute ago or 20 days ago. It's entirely possible there are 8000 NaN values between now and that last write so I can't reliably read in an array and search for the data. I was able to get the value using the URLfilter (url:https://thingspeak.com/channels/666/fields/2/last.json?api_key=BLECHIMTIREDOFFLAILING) but I can't see how I can retrieve the date/time.

I don't suppose there's a simple name/value pair for 'last?' Or perhaps a workaround?

I need to retrieve two or three values from the same channel and unfortunately it's not possible for me to split them up into their own dedicated channels.

thanks,
Brad

October 13, 2015
10:19 pm
Avatar
Hans
Natick, MA

Admin
Forum Posts: 407
Member Since:
January 18, 2011
sp_UserOfflineSmall Offline

Brad,

Try "webread" instead of urlfilter. This will allow you to get all of the data fields inside of last.json

Hans

October 14, 2015
6:25 pm
Avatar
AYAduino

Silver
Members
Forum Posts: 9
Member Since:
February 10, 2015
sp_UserOfflineSmall Offline

Thanks, exactly what I needed.

Brad

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
40 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

Janetkab, petersevruk, SGDamiano1, seanoz60, Beverlytreta, MartaKah

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457