Matrix.SetColumnName
--------------------

Sets column name.

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

MBS( "Matrix.SetColumnName"; MatrixRef; Column; Name ) 

**MBS**( **"Matrix.SetColumnName";** /\* Sets column name. \*/  
**$MatrixRef**; /\* The matrix reference number.e.g. $matrix \*/   
**$Column**; /\* The zero based column number.e.g. 2 \*/   
**$Name**) /\* The new name.e.g. "Company Name" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| MatrixRef | The matrix reference number. | $matrix |
| Column | The zero based column number. | 2 |
| Name | The new name. | "Company Name" |

### Result

Returns OK or error.

### Description

Sets column name.  
This is a value associated with the column. e.g. associate a field name with the column.  
Whenever you need to provide column index, you can also pass column name.  
### Examples

Try the column names:

 Set Variable \[ $matrix ; Value: MBS ("[Matrix.New](MatrixNew.md)"; 5; 6) \]   
\# name columns   
Set Variable \[ $r ; Value: MBS ("Matrix.SetColumnName"; $matrix ; 0; "First Name") \]   
Set Variable \[ $r ; Value: MBS ("Matrix.SetColumnName"; $matrix ; 1; "Last Name") \]   
Set Variable \[ $r ; Value: MBS ("Matrix.SetColumnName"; $matrix ; 2; "City") \]   
Set Variable \[ $r ; Value: MBS ("Matrix.SetColumnName"; $matrix ; 3; "Amount") \]   
\# show names   
Show Custom Dialog \[ "Column Names" ; MBS ("[Matrix.GetColumnNames](MatrixGetColumnNames.md)"; $matrix ) \]   
\# free   
Set Variable \[ $r ; Value: MBS ("[Matrix.Release](MatrixRelease.md)"; $matrix ) \]  
### See also

- [Matrix.CSV](MatrixCSV.md)
- [Matrix.GetColumn](MatrixGetColumn.md)
- [Matrix.GetColumnName](MatrixGetColumnName.md)
- [Matrix.GetColumnNames](MatrixGetColumnNames.md)
- [Matrix.GetValue](MatrixGetValue.md)
- [Matrix.New](MatrixNew.md)
- [Matrix.Release](MatrixRelease.md)
- [Matrix.SetColumn](MatrixSetColumn.md)
- [Matrix.SetColumnNames](MatrixSetColumnNames.md)
- [Matrix.SetRowName](MatrixSetRowName.md)

### Release notes

- **Version 12.5**
    - Added [Matrix.SetColumnNames](https://www.mbsplugins.eu/MatrixSetColumnNames.shtml) and [Matrix.SetRowNames](https://www.mbsplugins.eu/MatrixSetRowNames.shtml) functions.

### Blog Entries

- [News about the MBS FileMaker Plugin 10.2](https://www.mbsplugins.de/archive/2020-05-19/News_about_the_MBS_FileMaker_P/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 2nd April 2020 , last changed 2nd November 2020

  
[Matrix.SetColumn](MatrixSetColumn.md) - [Matrix.SetColumnNames](MatrixSetColumnNames.md)

[HTML Version](MatrixSetColumnName.shtml)