Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi all,
I want to reset all the properties of a thing to respective default values, how can this be done?
Thanks,
Sujith
Solved! Go to Solution.
(cannot edit last post for some reason)
Or just GetMetadata or via GetPropertyValues (also has default value)
With a service, you would have to pull the Property definitions and then find the 'default value' aspect.
Then assign that to the property value
I imagine you don't want to delete and recreate the Thing(s)
Hello,
how can one set a property of type "number" back to nothing (so that "set value" will be displayed)? I tried setting it to null and undefined but that didn't work. The workaround was to set it to 0, but that is not optimal for what I'm trying to achieve
Thank you!
unfortunately if setting to null or undefined doesn't work, then I don't know either.
Hi @PaiChung ,
How do I fetch the Property Definitions with Default value aspect, because the service GetPropertyDefinitions gives me only these fields:
TWX 9.2
Thanks,
Sujith
Follow up with specific getpropertydefinition should give you more.
Maybe you cut off some of the columns, isn't there an 'aspects' column? That would hold the information in regards to default value I believe.
Hi @PaiChung ,
There are no columns to cut off, only these many columns are available.
Thanks,
Sujith
I just went back to check and indeed ... it seems a whole lot of information is no longer supplied by GetPropertyDefinition
Not too sure what service to use anymore, I apologize.
@SB_9732186 service GetMetadataAsJSON will also return the default value - if a default value was specified in the property definition.
But I also have no idea on how to reset the property to "nothing".
(cannot edit last post for some reason)
Or just GetMetadata or via GetPropertyValues (also has default value)
Hi,
Anyone else has a solution for this?
Or do I have to raise a case?
Thanks,
Sujith