Matrix.GetValue
---------------

Queries a single value.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Matrix](component_Matrix.md) | [9.2](newinversion92.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Matrix.GetValue"; MatrixRef; Row; Column ) 

**MBS**( **"Matrix.GetValue";** /\* Queries a single value. \*/  
**$MatrixRef**; /\* The matrix reference number.e.g. $matrix \*/   
**$Row**; /\* The zero based row number.e.g. 2 \*/   
**$Column**) /\* The zero based column number.e.g. 2 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| MatrixRef | The matrix reference number. | $matrix |
| Row | The zero based row number. | 2 |
| Column | The zero based column number. | 2 |

### Result

Returns value or error.

### Description

Queries a single value.  
Retains original data type.  
See also [Matrix.Lookup](MatrixLookup.md) function.  
### Examples

Test setting and getting values:

 Set Variable \[ $matrix ; Value: MBS ( "[Matrix.New](MatrixNew.md)"; 3; 4 ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.SetValue](MatrixSetValue.md)"; $matrix ; 0; 0; "Hello" ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.SetValue](MatrixSetValue.md)"; $matrix ; 1; 0; 123,456 ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.SetValue](MatrixSetValue.md)"; $matrix ; 2; 0; Get(CurrentTimestamp )) \]   
Set Variable \[ $t ; Value: MBS ( "Matrix.GetValue"; $matrix ; 0; 0) \]   
Set Variable \[ $v ; Value: MBS ( "Matrix.GetValue"; $matrix ; 1; 0) \]   
Set Variable \[ $z ; Value: MBS ( "Matrix.GetValue"; $matrix ; 2; 0) \]   
Show Custom Dialog \[ "Results" ; $t &amp; ¶ &amp; $v &amp; ¶ &amp; $z \]   
Show Custom Dialog \[ "Results" ; MBS ("[FM.DataType](FMDataType.md)"; $t ) &amp; ¶ &amp; MBS ("[FM.DataType](FMDataType.md)"; $v ) &amp; ¶ &amp; MBS ("[FM.DataType](FMDataType.md)"; $z ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.Release](MatrixRelease.md)"; $matrix ) \]  
Use column name to read value:

 Let (\[  
// split a CSV  
matrix = MBS ( "[Matrix.CSVSplit](MatrixCSVSplit.md)"; "FirstName;LastName;City¶Joe;Miller;Las Vegas¶Bob;\\"Johnson-Meyer\\";\\"Köln\\"");  
// now move first row into column names  
firstRow = MBS ("[Matrix.GetRow](MatrixGetRow.md)"; matrix; 0);  
r = MBS ("[Matrix.SetColumnNames](MatrixSetColumnNames.md)"; matrix; firstRow);  
r = MBS ("[Matrix.RemoveRow](MatrixRemoveRow.md)"; matrix; 0);  
// now you can use column names to find columns!  
text = MBS ("Matrix.GetValue"; matrix; 0; "City");  
r = MBS ("[Matrix.Release](MatrixRelease.md)"; matrix)  
  
\]; text )  
### See also

- [Matrix.CSV](MatrixCSV.md)
- [Matrix.CSVSplit](MatrixCSVSplit.md)
- [Matrix.Evaluate](MatrixEvaluate.md)
- [Matrix.GetColumn](MatrixGetColumn.md)
- [Matrix.GetRow](MatrixGetRow.md)
- [Matrix.Lookup](MatrixLookup.md)
- [Matrix.New](MatrixNew.md)
- [Matrix.NewWithSQL](MatrixNewWithSQL.md)
- [Matrix.SetColumnName](MatrixSetColumnName.md)
- [Matrix.SetValue](MatrixSetValue.md)

### Blog Entries

- [Data structures in MBS Plugin](https://www.mbsplugins.de/archive/2023-11-27/Data_structures_in_MBS_Plugin/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2019, Seite 30](https://filemaker-magazin.de/neuigkeit/4053-Appetithappen-FMM_201904)

This function checks for a license.

Created 8th April 2019 , last changed 24th September 2023

  
[Matrix.GetText](MatrixGetText.md) - [Matrix.HTML](MatrixHTML.md)

[HTML Version](MatrixGetValue.shtml)