Community Tip - You can change your system assigned username to something more personal in your community settings. X
Trying to create a service query a Thing by name and check if it exists or not, but it seems I am having trouble with the Syntax. I looked at the Wike and tried to use the syntax there, but still get empty results.
Anybody knows an easy way to do it?
thanks
E
Hi Ewerton,
If you want to see if a Thing exists, you can do:
if (Things[thingName]) {
// It Exists
} else {
// It Doesn't
}
If the Thing does not exist, Things[thingName] will be null, which evaluates to false in a conditional.