List.InsertValue
----------------

Inserts a value to a list.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [List](component_List.md) | [7.1](newinversion71.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "List.InsertValue"; List; Index; Text ) 

**MBS**( **"List.InsertValue";** /\* Inserts a value to a list. \*/  
**$List**; /\* The list to process.e.g. "Hello" ¶ "" ¶ "World" \*/   
**$Index**; /\* the index where to insert.e.g. 0 \*/   
**$Text**) /\* The text to add.e.g. "Hello" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| List | The list to process. | "Hello" ¶ "" ¶ "World" |
| Index | the index where to insert. | 0 |
| Text | The text to add. | "Hello" |

### Result

Returns list or error.

### Description

Inserts a value to a list.  
Please note that [List.AddValue](ListAddValue.md) is more efficient than inserting.  
### Examples

Inserts a value in-between:

 MBS ( "List.InsertValue"; "Hello¶World"; 1; "Third" )  
### See also

- [List.AddValue](ListAddValue.md)

### Release notes

- **Version 8.0**
    - Fixed [List.InsertValue](http://www.mbsplugins.eu/ListInsertValue.shtml) for appending.
- **Version 7.1**
    - Added [List.AddValue](http://www.mbsplugins.eu/ListAddValue.shtml), [List.GetValue](http://www.mbsplugins.eu/ListGetValue.shtml), [List.InsertValue](http://www.mbsplugins.eu/ListInsertValue.shtml), [List.Remove](http://www.mbsplugins.eu/ListRemove.shtml), [List.RemoveValue](http://www.mbsplugins.eu/ListRemoveValue.shtml) and [List.SetValue](http://www.mbsplugins.eu/ListSetValue.shtml).

### Blog Entries

- [MBS FileMaker Plugin, version 7.6pr1](https://www.mbsplugins.de/archive/2017-12-06/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 11st March 2017 , last changed 15th January 2024

  
[List.IndexOfFirstValueMatching](ListIndexOfFirstValueMatching.md) - [List.Intersection](ListIntersection.md)

[HTML Version](ListInsertValue.shtml)