ListDialog.AddItemsToList
-------------------------

Adds entries 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.AddItemsToList"; titles { ; tags } ) 

**MBS**( **"ListDialog.AddItemsToList";** /\* Adds entries to the list. \*/  
**$titles**; /\* The titles to add.e.g. "Hello World" \*/   
**$tags**) /\* Optional; The tags, e.g. the record ID.e.g. "1234" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| titles | The titles to add. | "Hello World" |  |
| tags | The tags, e.g. the record ID. | "1234" | Optional |

### Result

Returns number of items.

### Description

Adds entries to the list.  
You can pass a list of items (separated with new line character)  
If tag for an item is #, plugin will mark this entry as header item.  
The titles text may contain in each line the text for multiple columns separated by tab character, e.g. char(9).  
### Examples

Add two items

 MBS ( "ListDialog.AddItemsToList"; "Hello¶World" )  
Add header with two items

 MBS ( "ListDialog.AddItemsToList"; "Names¶Steve¶Joe¶Geoff"; "#¶1¶2¶3" )  
Take two lists to fill two columns in a list dialog:

 MBS ("ListDialog.AddItemsToList"; MBS ( "[List.CrossProduct](ListCrossProduct.md)"; ListDialog::Text1 ; ListDialog::Text2 ; ""; Char(9); ""; 2))  
Query field 1 and field 2 merged together with tab character for adding to a list:

 MBS ( "[FM.ExecuteFileSQL](FMExecuteFileSQL.md)"; ""; "SELECT (\\"Field1\\" + Chr(9) + \\"Field2\\") FROM MyTable")  
Shows a list to pick an item from three items:

 Set Variable \[$r ; Value:MBS ("[ListDialog.ClearList](ListDialogClearList.md)")\]  
Set Variable \[$r ; Value:MBS ("[ListDialog.SetPrompt](ListDialogSetPrompt.md)"; "Please select an item:")\]  
Set Variable \[$r ; Value:MBS ("ListDialog.AddItemsToList"; "ein¶zwei¶drei")\]  
Set Variable \[$r ; Value:MBS ("[ListDialog.ShowDialog](ListDialogShowDialog.md)")\]  
Set Field \[ListDialog::Result ; $r \]  
Set Field \[ListDialog::Selected ; MBS ("[ListDialog.GetSelectedTitle](ListDialogGetSelectedTitle.md)")\]  
### See also

- [FM.ExecuteFileSQL](FMExecuteFileSQL.md)
- [List.CrossProduct](ListCrossProduct.md)
- [ListDialog.AddItemToList](ListDialogAddItemToList.md)
- [ListDialog.ClearList](ListDialogClearList.md)
- [ListDialog.GetSelectedTitle](ListDialogGetSelectedTitle.md)
- [ListDialog.SetPrompt](ListDialogSetPrompt.md)
- [ListDialog.ShowDialog](ListDialogShowDialog.md)
- [SyntaxColoring.AddContextMenuCommand](SyntaxColoringAddContextMenuCommand.md)

### Example Databases

- [List/ListDialog Grouping](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/List/ListDialog%20Grouping.shtml#1ScriptAnchor_)
- [List/ListDialog](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/List/ListDialog.shtml#1ScriptAnchor_)
- [SmartCard/Belgian EID Reader](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SmartCard/Belgian%20EID%20Reader.shtml#6ScriptAnchor_)
- [Win Only/Snippets for Windows](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Snippets%20for%20Windows.shtml#11ScriptAnchor_)

### Blog Entries

- [ListDialog for iOS](https://www.mbsplugins.de/archive/2025-08-18/ListDialog_for_iOS/monkeybreadsoftware_blog_filemaker)
- [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)

This function checks for a license.

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

  
[ListDialog.AddItemToList](ListDialogAddItemToList.md) - [ListDialog.AddSQL](ListDialogAddSQL.md)

[HTML Version](ListDialogAddItemsToList.shtml)