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
Dear Team,
How can we use properties file in Thingworx?
Thanks
Bhuwaneshwar Gupta
Hi Bhuwaneshwar, could you please elaborate on your use case and what sort of properties file are you referring to?
Hi Sushant,
During writting services I need to replace hardcode by properties.
Ex.
if(varForlongLati.Name == "Battery Status")
batteryStatus = varForlongLati.Value
Here Battery Status is hardcoded, so need to put in properties file.
I'm not sure where this property file for you exists, but one option could be to have a file in e.g. json format created and have that placed somewhere e.g. ThingWorxStorage folder and then load it's content using the FileReporsitory thing. There are some more services from FileSystem that you could use OOTB e.g. LoadJSON, LoadText, LoadXML, etc.
Hope this'd help