Has
Returns a value indicating whether the specified key exists in the dictionary.
| myDataTableDictionary.Has(key: string):boolean
|
Parameters
string key
The key to check.
Returns
true if the key exists in the dictionary; otherwise, false.
Examples
Report codes that do not exist in a table
| var products = $Database.Get({
TargetSchema : 'Sales',
TargetTable : 'Products'
}).ToDictionary('Code');
$Xml.SelectAll('Lines/Line', function (line) {
if (!products.Has(line.Evaluate('ProductCode'))) {
line.SetValue('Error', 'Unknown product');
}
});
|
See Also