thingspeakwrite - data table to field X in channel | ThingSpeak API | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.

Please consider registering

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
thingspeakwrite - data table to field X in channel
No permission to create posts
May 14, 2020
4:24 am
New Member
Forum Posts: 1
Member Since:
May 14, 2020
sp_UserOfflineSmall Offline


I've got problem with thingspeakwrite function,
I've read documentation here:, but there is no information about my issue, moreover I spend some time searching it in other places, and there is no response 🙁
My issue:
I've got data table like this:

dataTable =
10x1 timetable
cleanTimeStamps cleanWeatherData
____________________ ________________
14-May-2020 08:01:15 18.69
14-May-2020 08:02:16 18.56
14-May-2020 08:03:17 18.62
14-May-2020 08:04:18 18.75
14-May-2020 08:05:19 18.19
14-May-2020 08:06:19 18.19
14-May-2020 08:07:20 18.87
14-May-2020 08:08:21 18.19
14-May-2020 08:09:22 18.81
14-May-2020 08:10:23 18.75

I need to put this to field X in channel, where X is not 1.
I know that it is easy to put this to field 1, it can be done like this:
thingSpeakWrite(channelId, [dataTable],'WriteKey',writeAPIKey);
or this:
thingSpeakWrite(channelId, cleanWeatherData, 'Timestamp', cleanTimeStamps, 'WriteKey', writeAPIKey);
where dataTable = timetable(cleanTimeStamps,cleanWeatherData);

But is it possible to write it to field 3?

Have a nice day,

May 19, 2020
3:08 pm

Forum Posts: 885
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

There is a fields name value pair.
Try this:

thingSpeakWrite(channelId, cleanWeatherData, 'Timestamp', cleanTimeStamps, 'WriteKey', writeAPIKey,'fields',[3]);

You can also write null values to the first two columns of your data table and it will write the data you are interested in to field 3.

FYI, MATLAB answers is the preferred location for ThingSpeak Community support.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
25 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:

huldacormier, bogart, estebanmateo93, mikewrite, onlinebusiness, winzy99

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457