Programmatically add Things
I'd like to programmatically add new Things, but I want to have some validation to see if the Thing is already Created.
The validation I want to do is something like this
if(Things["ThingName"] == null)
{
//Then Create the thing
}
but by doing that, I receive the error which tells me : "Cannot read Property "ThingName" from undefined"
Then seeing that, I Created another service that will only retrieve the Thing name / project Name
But both of them didn't work telling me the same error as before (Cannot read Property "ThingName" from undefined)
By the way, the thing is already created.
This is the code I used :
var result = Things["ThingName"].GetProjectName();
returning result as output
Then I tried with another Entity (tried ThingTemplate) and it worked.
So first, is the Things[""] bugged for me ?
Second, how could I add the validation I'm looking for?
Message was edited by: Frederik Grondin

