---
name: "BIS_fnc_getServerVariable"
type: function
status: ok
groups: ["Variables"]
arma3_since: "1.00"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_getServerVariable
revid: 349343
updated: 2023-11-08T14:53:30Z
---

# BIS_fnc_getServerVariable

*Function · Variables · Arma 3 v1.00*

## Description

Fetch a variable saved on server.
Used when you want to share variables only to specific clients to prevent large traffic.
Must be run in [scheduled environment](../topics/Scheduler.md#scheduled_environment) because communication with server takes some time.

## Syntax

```sqf
[target, varName, default] call BIS_fnc_getServerVariable
```

**Parameters:**

- `target`: [Namespace](../topics/Namespace.md), [Object](../topics/Object.md) or [Group](../topics/Group.md) - variable name space
- `varName`: [String](../topics/String.md) - variable name
- `default`: [Anything](../topics/Anything.md) - default value returned when variable is [nil](../commands/nil.md)

**Returns:** [Anything](../topics/Anything.md) - default value or saved variable

## Examples

### Example 1

```sqf
[missionNamespace, "BIS_someVar", "defaultValue"] call BIS_fnc_getServerVariable;
```

## See also

[getVariable](../commands/getVariable.md) · [setVariable](../commands/setVariable.md) · [allVariables](../commands/allVariables.md)

<sub>Source: [BI Community Wiki — BIS fnc getServerVariable](https://community.bistudio.com/wiki/BIS_fnc_getServerVariable) (revision 349343).</sub>
