SharedMemory.SetValue
---------------------

Sets shared memory value.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SharedMemory](component_SharedMemory.md) | [10.1](newinversion101.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |

MBS( "SharedMemory.SetValue"; Name; Value ) 

**MBS**( **"SharedMemory.SetValue";** /\* Sets shared memory value. \*/  
**$Name**; /\* The name of the shared memory object.e.g. "test" \*/   
**$Value**) /\* The text value to store.  
e.g. an UUID to make it unique.e.g. "Hello World" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Name | The name of the shared memory object. | "test" |
| Value | The text value to store.   e.g. an UUID to make it unique. | "Hello World" |

### Result

Returns OK or error.

### Description

Sets shared memory value.  
MBS Plugin provides [SharedMemory](component_SharedMemory.md) functions to store UTF-8 text in shared memory, so one process can set it and other can read it, e.g. two versions of FileMaker Pro or two server processes.  
The value is lost when computer restarts, but stays when application quits.  
  
On Windows the shared memory objects can't be accessed from another login session. To create a truly global one, we would need to run FileMaker as administrator and prefix the name with "Global\\". And Windows deletes the shared memory when the last application referencing it closes.  
### Examples

Store text in shared memory:

 MBS ( "SharedMemory.SetValue"; "test"; "Hello World" )  
### See also

- [SharedMemory.DeleteValue](SharedMemoryDeleteValue.md)
- [SharedMemory.GetValue](SharedMemoryGetValue.md)
- [SharedMemory.LookupValue](SharedMemoryLookupValue.md)
- [Variable.Set](VariableSet.md)

### Release notes

- **Version 14.5**
    - Fixed [SharedMemory.GetValue](https://www.mbsplugins.eu/SharedMemoryGetValue.shtml) and [SharedMemory.SetValue](https://www.mbsplugins.eu/SharedMemorySetValue.shtml) functions to work with empty values.

### Blog Entries

- [MBS FileMaker Plugin, version 14.5pr4](https://www.mbsplugins.de/archive/2024-10-25/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Additional variable levels in FileMaker with MBS Plugin](https://www.mbsplugins.de/archive/2024-06-08/Additional_variable_levels_in_/monkeybreadsoftware_blog_filemaker)
- [Variable Levels in FileMaker](https://www.mbsplugins.de/archive/2022-07-06/Variable_Levels_in_FileMaker/monkeybreadsoftware_blog_filemaker)
- [New in the MBS FileMaker Plugin 10.1](https://www.mbsplugins.de/archive/2020-03-17/New_in_the_MBS_FileMaker_Plugi/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 2nd February 2020 , last changed 19th May 2025

  
[SharedMemory.LookupValue](SharedMemoryLookupValue.md) - [SharingPanel.AddFilePath](SharingPanelAddFilePath.md)

[HTML Version](SharedMemorySetValue.shtml)