# Dynamic Settings

**URL:** https://community.linx.software/community/t/dynamic-settings/393
**Category:** How To
**Created:** [March 29, 2019, 2:43pm UTC](https://community.linx.software/community/t/dynamic-settings/393 "2019-03-29T14:43:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ronan](https://community.linx.software/community/user_avatar/community.linx.software/ronan/32/433_2.png) [@ronan](https://community.linx.software/community/u/ronan)
#### Post date: [March 29, 2019, 2:43pm UTC](https://community.linx.software/community/t/dynamic-settings/393/1 "2019-03-29T14:43:51Z")

</div>

The **$.Settings** of a Linx solution are constants or static values, which are available to use throughout the entire solution. What happens in some cases is that a user may have a setting value defined, such as a long string like Database connection strings, QuickBooks credentials, etc.

It can however become quite cumbersome when there is a need for regular manual updates of setting values in different parts of your Solution. For example, in the long JSON format of QuickBooks credentials, the _AccessToken_ in development changes daily, which means that a user will have to update the large JSON string regularly.

To get around this tiresome activity, consider the following scenario:

a user may want to define a setting that has placeholders in it and then replace these values at runtime with other values. This ‘replace’ is normally done in the expression editor of the function in question.

For example, you may have a Database connection string defined as a Setting:

_Data Source=#Server#;Initial Catalog=#InitialCatalog#;Integrated Security=;User ID=#User#;Password=#Password#;_

![image](https://community.linx.software/uploads/default/original/1X/ec88c0954463947151ba2ee7338fb2654342132d.png)

Note: You don’t have to define the placeholders with ‘#’ - this is a personal style. It is recommended that you choose a placeholder style that will uniquely mark placeholders, i.e. not have them as simple words, because words that match the placeholder names may exist in the value for which you are searching and replacing.

Next, you can have other **$.Setting** values defined that will be used for the placeholders, like below:  
 ![image](https://community.linx.software/uploads/default/original/1X/ba2bf42793e49d42ffa31bc817361c584211e03a.png)

In an _ExecuteSQL_ function (used as an example), the connection string property can be defined as:  
 ![image](https://community.linx.software/uploads/default/original/1X/f5448d08394ed56ef76e3048f4a3f238edb86836.png)

This makes use of the _.Replace()_ command, and is created at runtime.

When a user has multiple SQL calls, s/he will need to include the _.Replace()_ command (as above), every time a Database function is used. Although s/he could copy the above expression and use it repeatedly, it still is a bit cumbersome and would be much easier if you could just point to one settings value.

You can achieve the above by doing the ‘replace’ in the **$.Setting** value itself (although this is a different replacing method than the one done in the Expression Editor).

To do this, you must make use of {} brackets to refer to another setting name, i.e. {#YourOtherSettingNameHere#}

For example:

Setting\_1: THIS IS MY OTHER SETTING  
Setting\_2: This is the setting and {Setting\_1}

Result at runtime:

_This is the setting and THIS IS MY OTHER SETTING_

In our database connection string example (see above), it would look like:

_Data Source={Credentials\_Server};Initial Catalog={Credentials\_InitialCatalog};Integrated Security=;User ID={Credentials\_Username};Password={Credentials\_Password};_

At runtime, the connection string would be:

_Data Source=MYSERVER-2019;Initial Catalog=TestTable;Integrated Security=;User ID=MyUser;Password=Password123456;_

Once you have set up this dynamic setting correctly, you are able to refer to this setting throughout your solution, instead of using the _.Replace()_ method each time.

![image](https://community.linx.software/uploads/default/original/1X/bd3b24907c0df5aeb7080e270be84ef17ceeeb9f.png)
