cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

AddPropertyDefinitions Not Working

travman7777
12-Amethyst

AddPropertyDefinitions Not Working

I am trying to utilize the AddPropertyDefinitions function to add multiple properties to a thing.  However I am unsuccessful.  I am able to individually add a property by using AddPropertyDefinition, however when I try and using AddPropertyDefinitions the properties are not added.  Is this a bug with the function or is there something wrong in my code.  I have attached an exported file of the Thing/Service for reference.

 

Using TWX 9.1

ACCEPTED SOLUTION

Accepted Solutions
TonyZhang
14-Alexandrite
(To:travman7777)

Hi there,

 

Firstly I think you should use name "baseType" instead of "type" when specifying property type

Secondly there is a missing semicolon after "let turnedOn = {...}"

Could you please try again after making above adjustment in your service see how it goes?

Tony

View solution in original post

2 REPLIES 2
TonyZhang
14-Alexandrite
(To:travman7777)

Hi there,

 

Firstly I think you should use name "baseType" instead of "type" when specifying property type

Secondly there is a missing semicolon after "let turnedOn = {...}"

Could you please try again after making above adjustment in your service see how it goes?

Tony

Hi Tony,  Changing type to baseType fixed the issue.  Good catch.

Announcements


Top Tags