23
Views
5
Comments
Is there a way to store config in outsystems

Hi All,


I have a use case of store certain settings which are specific to my application. Settings can change with environment. 

More or less equivalent to app.config.

Can someone please help on this?

2023-04-06 11-24-23
Paulo Zacarias

Hi Rajat, 

If you want specific configurations across different environments, you can use Site Properties. 

https://success.outsystems.com/documentation/11/reference/outsystems_language/data/handling_data/site_property/

These will allow you to change values at runtime. 

Hope this helps.

Regards, 

PZ

UserImage.jpg
Rajat Singhal

Will it be possible to store objects as well in this 

eg

environment1 ={config1,config2}

environment2 ={config1,config2}

2023-04-06 11-24-23
Paulo Zacarias

Hi Rajat, 

It is not possible to define a Site Property with a complex structure. 

However, you can build a string to store n configurations and then read and work that string through some text actions like StringSplit(), Replace(), etc.

Edit: You can have n site properties per module, example: Config1, Config2, Config3 
and set the default values for each configuration. 

Regards, 

PZ

2023-03-16 16-29-51
Paulo Rosário

Hello Rajat, 

Like Paulo said you cannot store complex objects in a Site property you can however store objects as JSON and then desirializing the value to create your structures. This is not really recommended as a best practice due to the way Site properties work. 

To manage Configs, ideally, you would have an entity that holds the values that you need for each environment and fetch them as needed, usually OnApplicationReady. This does require some kind of back office to be able to add/edit records. 

Hope it helps! 

Paulo Rosário 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.