Application icon

List Contains Test

This function tests if a list in a field or named variable, with a specified delimiter, has an item equalling, containing, srating with or ending with specified data.

The comparison operation may be performed case insensitive.

The action test state is set to true if a matching item is found, otherwise false.

If the Remove option is specified, the item will be removed from the list.

If the Save index to option is specified, the index of a matched item will be saved to the specified variable or named variable. Note the result will be set to empty if no match is made. Note also, that while the index may be saved, it may be meaningless if the item is removed.

If the Save item to option is specified, the matched item will be saved to the specified variable or named variable. Note the result will be set to empty if no match is made. This is typically only useful when testing if the data is contained.

If the delimiter resolves to be empty when the action is executed, a default (\~) will be assumed.

All text fields may contained any of the escape sequences described in Escape Sequences. Note that the processing occurs only once with the contents of the first file.

Note that when running stepwise there are some special considerations:

Example: Assume the Artist field contains a list of artists separated by commas. You want to ensure that the Album Artist, if present in the list always comes first. The following action will implement the desired functionality:

Force Grouped Execution
Copy the Album Artist field to Variable 1
Test if the list in field Artist delimiter "," has an item equalling case insensitive "\v1", remove
if true
   Add '\v1' to the start of the list in field Artist delimiter ','
endif