ListDialog.AddItemToList
------------------------

Adds a line to the list.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [ListDialog](component_ListDialog.md) | [4.2](newinversion42.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "ListDialog.AddItemToList"; Title { ; Tag; Header } ) 

**MBS**( **"ListDialog.AddItemToList";** /\* Adds a line to the list. \*/  
**$Title**; /\* The title to show.e.g. "Hello World" \*/   
**$Tag**; /\* Optional; The tag, e.g. the record ID.e.g. "1234" \*/   
**$Header**) /\* Optional; Pass 1 to make this an header item, which is shown differently.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Title | The title to show. | "Hello World" |  |
| Tag | The tag, e.g. the record ID. | "1234" | Optional |
| Header | Pass 1 to make this an header item, which is shown differently. | 1 | Optional |

### Result

Returns OK.

### Description

Adds a line to the list.  
The title text may contain text for multiple columns separated by tab character, e.g. char(9).  
### Examples

Clears list and adds three lines:

 MBS ( "[ListDialog.ClearList](ListDialogClearList.md)" )  
MBS ( "ListDialog.AddItemToList"; "Bob"; 1 )  
MBS ( "ListDialog.AddItemToList"; "Joe"; 2 )  
MBS ( "ListDialog.AddItemToList"; "Tim"; 3 )  
Use two columns and fill an item to the list:

 Set Variable \[ $r ; Value: MBS ("[ListDialog.SetColumnCount](ListDialogSetColumnCount.md)"; 2) \]   
Set Variable \[ $r ; Value: MBS ("ListDialog.AddItemToList"; "1st Column" &amp; Char(9) &amp; "2nd Column"; "Tag123") \]  
### See also

- [List.HasValue](ListHasValue.md)
- [ListDialog.AddItemsToList](ListDialogAddItemsToList.md)
- [ListDialog.ClearList](ListDialogClearList.md)
- [ListDialog.SetColumnCount](ListDialogSetColumnCount.md)
- [ListDialog.ShowDialog](ListDialogShowDialog.md)

### Example Databases

- [List/ListDialog](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/List/ListDialog.shtml#1ScriptAnchor_)
- [Mac and iOS/PDFKit/PDFKit Print Documents](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/PDFKit%20Print%20Documents.shtml#3ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Advent calendar - Door 10 - Reading The Wish List](https://www.mbsplugins.de/archive/2024-12-10/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 22 - ListDialog](https://www.mbsplugins.de/archive/2023-12-22/MBS_Plugin_Advent_calendar_22_/monkeybreadsoftware_blog_filemaker)
- [New functions of the MBS Plugin Version 9.5](https://www.mbsplugins.de/archive/2019-11-21/New_functions_of_the_MBS_Plugi/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 20th May 2025

  
[List.XOrColumn](ListXOrColumn.md) - [ListDialog.AddItemsToList](ListDialogAddItemsToList.md)

[HTML Version](ListDialogAddItemToList.shtml)