> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the current value of a given preference

> How to get preferences using SoPreferene at the data layer

The [SetPreference method][2] has four overloads depending on the value passed (string, int, bool, or DateTime). The `SoPreference` class provides four corresponding methods to retrieve the current value of a given preference.

```csharp theme={null}
using SuperOffice;
using SuperOffice.Data;
using(SoSession mySession = SoSession.Authenticate("sam", "sam"))
{
  bool value = SoPreference.GetBool("Visual", "SundayFirstDay", false);
}
```

The example above retrieves whether the calendar for the signed-in user begins with Sunday or Monday. In this case, since `GetBool()` requires 3 parameters, the default value of the key should also be passed in. The default value parameter should be passed in only when using the `GetBool` method.

See also: [intro to cache][1]

[1]: ../../../caching/index

[2]: ./set-preferences-sopreference


## Related topics

- [Get the current value of a given preference](/en/api/web-services/howto/user-preferences/get-preferences-preferenceagent.md)
- [SuperOffice.WebApi.Agents.PreferenceAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.PreferenceAgent.md)
- [SuperOffice.WebApi.Agents.IPreferenceAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IPreferenceAgent.md)
- [Get Preferences With Display Values](/en/api/reference/restful/agent/preference_agent/get-preferences-with-display-values.md)
- [Resource providers](/en/api/localization/language/resource-providers.md)
- [User preferences](/en/admin/user-preferences/index.md)
- [Get Xsrf Value](/en/api/reference/restful/agent/preference_agent/get-xsrf-value.md)
