Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi,
i have many Things with "Database" as Thing Template and i would like to make a service which sets the password to the database automatically (on running the service).
i looked into the snippets and found nothing so i thought it might be a security policy.
is it possible? Thanks :)
Solved! Go to Solution.
Hello,
Configuration section of a thing it's based on Configuration Tables, you should look on the services related to Configuration Tables in order to change any property shown on that section. Let's start:
Carles.
Hello,
Configuration section of a thing it's based on Configuration Tables, you should look on the services related to Configuration Tables in order to change any property shown on that section. Let's start:
Carles.
Hi Charles,
thanks for the answer! I tried as you said but i am facing a problem.
// result: INFOTABLE dataShape: "EntityList"
var result = me.GetConfigurationTables();
// table: INFOTABLE dataShape: ""
var table = me.GetConfigurationTable({
tableName: "ConnectionInfo" /* STRING */
});
me.SetConfigurationTableRows({
values: undefined /* INFOTABLE */,
persistent: undefined /* BOOLEAN */,
tableName: undefined /* STRING */
});
Here, at SetConfigurationTableRows, what am i supposed to fill? i cannot see the connection to the password i would like to change. Thank you!
Something like this should do the trick:
var newPassword ="newDesiredPassword"; var databaseName = "yourDataBaseName"; var tableName = "ConnectionInfo"; var actual = Things["PersistenceProviderSystemDatabase"].GetConfigurationTable({ tableName: tableName }); actual.rows[0].password = Resources["EncryptionServices"].EncryptPropertyValue({ data: newPassword }); Things[databaseName].SetConfigurationTable({ configurationTable: tableName, persistent: true, tableName: tableName });
Hi @gabitudor.
If one of the responses provided by @CarlesColl answered your question, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon