Skip to main content
1-Visitor
June 29, 2016
Solved

how to create a thing and set Property in another thing service whit javascript

  • June 29, 2016
  • 1 reply
  • 3487 views

i have created a thing with javascript in the snipert service CreateThing ,but then i want to set the thing just created Propertis ,the thing create success,but the properties created failed.there is nothing error shown in Application ,this my script

Best answer by CarlesColl

You need a restart after the EnableThing and before setting the property:

Things[thingName].RestartThing();

Also you need to create the Thing with the prepared parameters ( before (EnableThing) 😞

Resources["EntityServices"].CreateThing(params);

1 reply

lfen1-VisitorAuthor
1-Visitor
June 29, 2016

can not set Properties success too

1-Visitor
June 29, 2016

You need a restart after the EnableThing and before setting the property:

Things[thingName].RestartThing();

Also you need to create the Thing with the prepared parameters ( before (EnableThing) 😞

Resources["EntityServices"].CreateThing(params);

lfen1-VisitorAuthor
1-Visitor
June 30, 2016

thank you so much ,your answer solve my problem perfectly!