Python.SetValue
---------------

Sets a variable in the Python environment.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Python](component_Python.md) | [14.3](newinversion143.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Python.SetValue"; PythonRef; VariableName; Value ) 

**MBS**( **"Python.SetValue";** /\* Sets a variable in the Python environment. \*/  
**$PythonRef**; /\* The Python reference number.e.g. $python \*/   
**$VariableName**; /\* The variable name.e.g. "test" \*/   
**$Value**) /\* The value to set. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PythonRef | The Python reference number. | $python |
| VariableName | The variable name. | "test" |
| Value | The value to set. |  |

### Result

Returns OK or error.

### Description

Sets a variable in the Python environment.  
You may use the variable to easily transfer huge blocks of JSON text to process in Python.  
Use [Python.GetValue](PythonGetValue.md) later to query value back.  
### Examples

Set a variable:

 Set Variable \[ $r ; Value: MBS ("Python.SetValue"; $p ; "Hello"; "World") \]  
### See also

- [Python.DeleteValue](PythonDeleteValue.md)
- [Python.GetValue](PythonGetValue.md)
- [Python.HasValue](PythonHasValue.md)
- [Python.Run](PythonRun.md)
- [Python.SetInput](PythonSetInput.md)

### Example Databases

- [Python](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Python.shtml#2ScriptAnchor_)

### Blog Entries

- [Using Python in FileMaker](https://www.mbsplugins.de/archive/2024-06-24/Using_Python_in_FileMaker/monkeybreadsoftware_blog_filemaker)

Created 23th May 2024 , last changed 31st May 2024

  
[Python.SetTag](PythonSetTag.md) - [Python.Time](PythonTime.md)

[HTML Version](PythonSetValue.shtml)