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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Reset thing property value to default value

SB_9732186
11-Garnet

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

1 ACCEPTED SOLUTION

Accepted Solutions
nmutter
14-Alexandrite
(To:nmutter)

(cannot edit last post for some reason)

Or just GetMetadata or via GetPropertyValues (also has default value)

View solution in original post

12 REPLIES 12
PaiChung
22-Sapphire I
(To:SB_9732186)

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)

HD_10225728
6-Contributor
(To:PaiChung)

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!

PaiChung
22-Sapphire I
(To:HD_10225728)

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:

SB_9732186_0-1658152746370.png

TWX 9.2

 

Thanks,

Sujith

PaiChung
22-Sapphire I
(To:SB_9732186)

Follow up with specific getpropertydefinition should give you more.

Hi @PaiChung ,

 

GetPropertyDefinition gives the same fields as well,

 

Thanks,

Sujith

PaiChung
22-Sapphire I
(To:SB_9732186)

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.

SB_9732186_0-1658377275116.png

 

Thanks,

Sujith

PaiChung
22-Sapphire I
(To:SB_9732186)

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.

 

nmutter
14-Alexandrite
(To:PaiChung)

@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".

nmutter
14-Alexandrite
(To:nmutter)

(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

Top Tags