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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to check for invalid characters in property name

a_labrecque
5-Regular Member

How to check for invalid characters in property name

Hi,

 

I'm looking for a way to validate a property name before it gets created. Basically, the name of the property is chosen at Runtime by a user, so I'll need to double-check if the Name entered for the property is valid.

 

Is there a service I can use to verify a specified Name for service AddPropertyDefinition?

 

Thanks!

2 REPLIES 2

Hello @a_labrecque ,

 

Regarding a a way to validate a property name before it gets created there is a similar community post which might help you

 

https://community.ptc.com/t5/ThingWorx-Developers/Code-Snippet-to-check-if-any-property-already-exist-in-thing/m-p/664093#M44880

 

 

Hope it helps,

a_labrecque
5-Regular Member
(To:Ciprian-Traian)

Hi @Ciprian-Traian,

 

Thanks for the response. However, the post you linked me too doesn't contain what I'm looking for.

 

I'll probably have to create a service to replicate how Thingworx validates if a property name is valid by looking if the string starts with a letter and if it contains invalid character (such as whitespace). I'm a bit reluctant to do so, since I may overlook some cases, and if the Thingworx validation ever gets updated, my service won't be in sync.

Announcements


Top Tags