Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Is there any possible way to update a Thing's Property attributes (Read Only, Persistent, Base Type, Category, etc) via script? I found the service 'SetPropertyLogging' for turning on/off data logging, but I can't find any similar service to take care of the other attributes.
I want to be able to use a Service to update these aspects for many already-existing properties at once.
Solved! Go to Solution.
Currently not part of ThingWorx functionality https://www.ptc.com/en/support/article?n=CS281204
I'd try to work with REST calls. In your browser, open dev tools (f12 in chrome). When you update your property attributes manually, note the requests showing up in the Network tab. It should show the request and headers.
Try "AddPropertyDefinition".
me.AddPropertyDefinition({
defaultValue: undefined /* STRING */,
remoteBindingAspects: undefined /* JSON */,
description: undefined /* STRING */,
readOnly: undefined /* BOOLEAN */,
remote: undefined /* BOOLEAN */,
type: undefined /* BASETYPENAME */,
remotePropertyName: undefined /* STRING */,
timeout: undefined /* INTEGER */,
pushType: undefined /* STRING */,
dataChangeThreshold: undefined /* NUMBER */,
logged: undefined /* BOOLEAN */,
name: undefined /* STRING */,
pushThreshold: undefined /* NUMBER */,
dataChangeType: undefined /* STRING */,
category: undefined /* STRING */,
persistent: undefined /* BOOLEAN */,
dataShape: undefined /* DATASHAPENAME */
});
I did try this. This service will throw an error because it's trying to create a property with a name that already exists. I could delete my properties and recreate, but I'd like to avoid that scenario.
Currently not part of ThingWorx functionality https://www.ptc.com/en/support/article?n=CS281204
I'd try to work with REST calls. In your browser, open dev tools (f12 in chrome). When you update your property attributes manually, note the requests showing up in the Network tab. It should show the request and headers.
Hi @Ascherer17.
If the response provided by Constantine answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon