Skip to main content
10-Marble
November 6, 2017
Question

How To use Properties file

  • November 6, 2017
  • 1 reply
  • 1688 views

Dear Team,

How can we use properties file  in Thingworx?

Thanks

Bhuwaneshwar Gupta

1 reply

5-Regular Member
November 6, 2017

Hi Bhuwaneshwar, could you please elaborate on your use case and what sort of properties file are you referring to?

bgupta-210-MarbleAuthor
10-Marble
November 6, 2017

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.



5-Regular Member
November 6, 2017

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