Hi Team
Who can explain to me as to why in thingspeak, you only have limited option to chose either read one field? But your data format on JSON or CSV show all feeds not one you wish to see? I am having that issue now with my CSV file format, on my URL i am passing correct request as field 1.json format. But the file format seem to give me all feeds.
// Downloading file into csv/json format.
$(document).ready(function() {
$("#download").click(function() {
var count = 0;
if($('#temperature').prop('checked')) count++;
if($('#illuminance').prop('checked')) count++;
if($('#button-state').prop('checked')) count++;
if(count > 1) {
window.location.href ='https://api.thingspeak.com/channels/899906/feeds.json?start=2019-11-14%2019:11:14&end=2019-11-18%2019:11:18';
}else{
// checking for one field being checked.
if($('#temperature').prop('checked')) count--;
if($('#illuminance').prop('checked')) count--;
if($('#button-state').prop('checked')) count--;
if(count < 1) {
window.location.href = ' https://api.thingspeak.com/channels/899906/fields/1.json?start=2019-11-15%2019:11:15&end=2019-11-18';
}
}
});
});
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Guest UserPosted Nov 19, 2019, 1:57 AM