Using field data as dependency in JavaScript If/Else statement | ThingSpeak Plugins | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
Using field data as dependency in JavaScript If/Else statement
Avatar
jteindl

Silver
Forum Posts: 8
sp_UserOfflineSmall Offline
1
July 31, 2017 - 10:55 am
sp_Permalink sp_Print
In my JavaScript I have a number of variables as shown below:
 
stop = new google.maps.LatLng(59.093914487013, -122.71569423377514)
waypts.push({
location: stop,
stopover: true
 
The line in Bold is what I need help with. I have data transmitted to Thingspeak. I have an API that allows me to select the exact value to query; what I need to know is how to use a GET statement (Or anything that would work) to have that Stopover line be True or False based on the result. So IF the result queried by the API is over 8, it's TRUE, if it's under it is false.
 
The API line looks like this: 
 
GET https://api.thingspeak.com/channels/****/fields/1.json?results=2
So How do I set that Bold field to query this and either be TRUE or FALSE based upon the result of this query?
 
If you need any more info please reply and I can fill in any blanks, but I'm reallllly needing some help here.
 
Thank you! 
Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 250

Vinod: 152

piajola: 74

vespapierre: 63

cstapels: 60

Adarsh_Murthy: 59

Newest Members:

bharad

mikebradley

gilloliver

chputney

fibula

namansahore

Forum Stats:

Groups: 4

Forums: 17

Topics: 1261

Posts: 4400

 

Member Stats:

Guest Posters: 1

Members: 5588

Moderators: 0

Admins: 2

Administrators: Hans, lee