Hello, I need help with a weird issue I encountered. I'm trying to change the values for a Site Property, but it won't update unless I manually republish from the Service Center, and I understand that it should work automatically. Does anyone know what could be the issue or what I should do? Thank you.
Hi Javier,
I hope you're doing well.
Regarding Site Properties, you can change the value in the Service Center or in the Service Studio.
Are you trying to change the value of a Site Property in runtime?
If yes, you can do an assign in your logic to change the Site Property value.
Btw, is not best practice to change the Site Property value.
Can you describe better your issue, please?
Kind regards,
FC
I use a site property to change the value of a boolean variable from False to True and vice versa. This is done to pass the variable to a container, and depending on its value, display the content of the container for visualizing things without the need to publish. The issue is that when I change the variable value in the "site property" in the Service Center, it is not reflected in the browser; in other words, the variable doesn't change. I noticed that when I modify the variable, my project is not automatically republished. To see the changes, I have to manually republish in the Service Center, even though this should be automatic. I hope my issue is clearer now. Thank you.
Javier,
You should change the Site Property value on the Service Center (Service Center > Factory > Modules > "YourModuleName" > Site Properties > "YourSiteProperty").
You don't need to publish your application, you only need to change the site property value and click on the button appy.
In my example, the Site Property value is "FALSE":
So In the UI, the text displayed is: "The Site Property value is 'FALSE'":
In the Service Center, I changed the value of my Site Property to "TRUE" and I clicked apply:
After that, In the UI, the text displayed is: "The Site Property value is 'TRUE'".
Let me know if this makes sense to you and if solves your issue.
I do the same thing! But it doesn't change the value of the variable for me. For example, if it's set to "True" and I change it to "False," it still shows as "True" in the browser. However, if I click on "publish" in the service center, the variable changes.
That's strange.
Can you share your OML file, please?
Like Fábio mentioned changing a site property in code it's not a best practice.
Check out here why
https://success.outsystems.com/documentation/11/managing_the_applications_lifecycle/manage_technical_debt/code_analysis_patterns/avoid_site_property_updates/
You can achieve the same result using an configuration entity and storing configuration values on it.
Hope that it helps you
I explained it incorrectly. The application is already up and running. What I do is, through the site property in the service center, I change the server's boolean variable from true to false. However, here's the issue: the variable doesn't take the value from the service center. I have to republish the app through the service center (the latest version) to update the variable. I'll send a screenshot of my problem for better clarity in a few hours. Thank you.
Check out this part
"If you want to use the value of a Site Property in the client-side logic of a mobile application, you must add a Server Action to get the Site Property value and use that Server Action in your client-side logic.
Site Properties are stored in cache of your application until invalidated."
from
https://success.outsystems.com/documentation/11/developing_an_application/use_data/use_site_properties_to_configure_behaviors_at_runtime/
You can also add some logs in the logic where you are using the site property to be able to understand what can be missing.
Hi @Javier Saavedra Zaravia ,
I hope the issue might be resolved by now. I faced this same issue recently and I was able to make it work by
* Clearing browser's cache
* Publishing the module from Service center.
Hope it might be useful for any of the future cases.