Reset thing property value to default value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Reset thing property value to default value
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.
- Labels:
-
Coding
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
(cannot edit last post for some reason)
Or just GetMetadata or via GetPropertyValues (also has default value)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
unfortunately if setting to null or undefined doesn't work, then I don't know either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Follow up with specific getpropertydefinition should give you more.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @PaiChung ,
There are no columns to cut off, only these many columns are available.
Thanks,
Sujith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
(cannot edit last post for some reason)
Or just GetMetadata or via GetPropertyValues (also has default value)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
Anyone else has a solution for this?
Or do I have to raise a case?
Thanks,
Sujith
