Dictionary.Lookup
-----------------

Looks up value for the key.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Dictionary](component_Dictionary.md) | [12.1](newinversion121.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Dictionary.Lookup"; DictionaryRef; Key { ; DefaultValue } ) 

**MBS**( **"Dictionary.Lookup";** /\* Looks up value for the key. \*/  
**$DictionaryRef**; /\* The reference number to the dictionary.e.g. $dic \*/   
**$Key**; /\* The key to use. Keys are case sensitive.e.g. "FirstName" \*/   
**$DefaultValue**) /\* Optional; The default value to return if key is not found.  
Default for the default value is an empty string.e.g. "" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| DictionaryRef | The reference number to the dictionary. | $dic |  |
| Key | The key to use. Keys are case sensitive. | "FirstName" |  |
| DefaultValue | The default value to return if key is not found.   Default for the default value is an empty string. | "" | Optional |

### Result

Returns value or error.

### Description

Looks up value for the key.  
As dictionary preserves data type, result can be empty, text, number, date, time, timestamp, container or boolean.  
Returns default value (or empty result), if key is not found.   
  
Similar to [Dictionary.ValueForKey](DictionaryValueForKey.md), but without an error, but a default value.  
### Examples

Query UUID for something and make new one if it's not found:

 MBS ( "Dictionary.Lookup"; $IDDic ; $id ; Get(UUID) )  
### See also

- [Dictionary.ToJSON](DictionaryToJSON.md)
- [Dictionary.ToText](DictionaryToText.md)
- [Dictionary.ValueForKey](DictionaryValueForKey.md)

### Release notes

- **Version 12.1**
    - Added [Dictionary.Lookup](https://www.mbsplugins.eu/DictionaryLookup.shtml) function.

### Blog Entries

- [Data structures in MBS Plugin](https://www.mbsplugins.de/archive/2023-11-27/Data_structures_in_MBS_Plugin/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 12.1](https://www.mbsplugins.de/archive/2022-03-22/New_in_MBS_FileMaker_Plugin_12/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 12.1](https://www.mbsplugins.de/archive/2022-03-15/Neues_MBS_FileMaker_Plugin_121/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 12.1 - More than 6700 Functions In One Plugin](https://www.mbsplugins.de/archive/2022-03-15/MBS_FileMaker_Plugin_121_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.1pr3](https://www.mbsplugins.de/archive/2022-02-16/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 15th February 2022 , last changed 24th November 2023

  
[Dictionary.List](DictionaryList.md) - [Dictionary.Release](DictionaryRelease.md)

[HTML Version](DictionaryLookup.shtml)