ListDialog.SetFilter
--------------------

Sets the current filter text.

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

MBS( "ListDialog.SetFilter"; Value { ; Placeholder } ) 

**MBS**( **"ListDialog.SetFilter";** /\* Sets the current filter text. \*/  
**$Value**; /\* The new filter text.e.g. "" \*/   
**$Placeholder**) /\* Optional; The placeholder text to show if there is no filter.  
Set to "" if you don't want the text.e.g. "Filter" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Value | The new filter text. | "" |  |
| Placeholder | The placeholder text to show if there is no filter.   Set to "" if you don't want the text. | "Filter" | Optional |

### Result

Returns OK or error.

### Description

Sets the current filter text.  
The filter will be applied next time [ListDialog.ShowDialog](ListDialogShowDialog.md) is used.  
You may want to use [ListDialog.SetShowsFilter](ListDialogSetShowsFilter.md) to show the filter field.  
  
Filtering may not work with grouping well.  
### Examples

Set filter:

 Set Variable \[ $r ; Value: MBS ( "ListDialog.SetFilter"; "New") \]  
### See also

- [FileDialog.GetFilter](FileDialogGetFilter.md)
- [FileDialog.SetFilter](FileDialogSetFilter.md)
- [ListDialog.GetFilter](ListDialogGetFilter.md)
- [ListDialog.GetWidth](ListDialogGetWidth.md)
- [ListDialog.SetShowsFilter](ListDialogSetShowsFilter.md)
- [ListDialog.SetWidth](ListDialogSetWidth.md)
- [ListDialog.ShowDialog](ListDialogShowDialog.md)

### Release notes

- **Version 11.0**
    - Added filter for ListDialog and related functions: [ListDialog.GetFilter](https://www.mbsplugins.eu/ListDialogGetFilter.shtml), [ListDialog.GetShowsFilter](https://www.mbsplugins.eu/ListDialogGetShowsFilter.shtml), [ListDialog.SetFilter](https://www.mbsplugins.eu/ListDialogSetFilter.shtml) and [ListDialog.SetShowsFilter](https://www.mbsplugins.eu/ListDialogSetShowsFilter.shtml).

### Blog Entries

- [MBS Plugin Advent calendar: 22 - ListDialog](https://www.mbsplugins.de/archive/2023-12-22/MBS_Plugin_Advent_calendar_22_/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 11.0](https://www.mbsplugins.de/archive/2021-01-26/New_in_MBS_FileMaker_Plugin_11/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.6pr1](https://www.mbsplugins.de/archive/2020-12-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Filter for ListDialog](https://www.mbsplugins.de/archive/2020-11-22/Filter_for_ListDialog/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 21st November 2020 , last changed 27th January 2021

  
[ListDialog.SetColumnWidth](ListDialogSetColumnWidth.md) - [ListDialog.SetHeight](ListDialogSetHeight.md)

[HTML Version](ListDialogSetFilter.shtml)