mapList

mapList(table, list, separator, default=null): String

Lookup multiple keys (separated by user-defined separator) from mapping table. Result string is joined using the same separator.

Table 1. Parameters

table

name or ID of the mapping table.

list

string of keys separated by separator.

separator

separator used to split list and to produce output. Only the first character is used for splitting.

default

Optional. Value used for keys not found in the mapping table. If omitted, an empty string is used for such keys.

Return

String with mapped values joined by separator. If the mapping table does not exist, the table argument is returned instead of list (known issue, netxms#3802).

Provided that there is a mapping table named "table1", which has keys 10, 20 and 30 with corresponding values "value1", "value2" and "value3":

println(mapList("table1", "10,20,30", ",")); // prints "value1,value2,value3"
println(mapList("table1", "10,20,30,40", ",", "NOT FOUND"));  // prints "value1,value2,value3,NOT FOUND"