Is there a way to update site property through API in react web outsystems

Hi Guys,

Is there a way to update site property through API. As an example my site property

Site.TestData = "BL_OS"

Is there a way to create api and use this api in admin, so that i can edit the text of this site property.

Hi touseef ahmed ,

You can do your API to change the Site Property value, note about the cache invalidation needed.

There is another post where you can find more information: https://www.outsystems.com/forums/discussion/46243/updating-site-property/

Cheers!

Hi touseef ahmed,

First of all, it's not recommended to change site properties at runtime. This is because they are cached so the platform doesn't have to retrieve it from the database for every request. When you update the value, the new value will be assigned and the cache is refreshed. This gives a relatively big performance impact and possible cache invalidation issues.

The question is: why do you want to do this?

That being said, and if you want to do it anyway: you can assign site properties just like any other variables. So, you could make an API module and expose an REST API with an input parameter that calls a server action that assigns the value of the input parameter to the site property.

Marco Arede wrote:

Hi touseef ahmed ,

You can do your API to change the Site Property value, note about the cache invalidation needed.

There is another post where you can find more information: https://www.outsystems.com/forums/discussion/46243/updating-site-property/

Cheers!

 Hi @Marco,


thanks...   :)

 

Jobbe Maas wrote:

Hi touseef ahmed,

First of all, it's not recommended to change site properties at runtime. This is because they are cached so the platform doesn't have to retrieve it from the database for every request. When you update the value, the new value will be assigned and the cache is refreshed. This gives a relatively big performance impact and possible cache invalidation issues.

The question is: why do you want to do this?

That being said, and if you want to do it anyway: you can assign site properties just like any other variables. So, you could make an API module and expose an REST API with an input parameter that calls a server action that assigns the value of the input parameter to the site property.

 Hi @Jobbe,

This is client requirement. There is application number with prefix. As example "AB1231321421". AB i will keep in the site property. So if i need to change to DE instead of AB then i need an api to change through admin module rather than from service center. 

Thanks. 

 

Hi Touseef,

There are a few Forge components out there that already include this functionality.

Take note that there are one or more dependencies for both components that need to be installed in your environment.

Regards,

Nordin

touseef ahmed wrote:

This is client requirement. There is application number with prefix. As example "AB1231321421". AB i will keep in the site property. 

 Hi touseef,

It is not a client requirement to keep it in a site property, that's a technical decision! Like others have said, site properties should not be changed at runtime, they should be considered as static. If you need dynamically updatable values, use the database!