List<Type>
Last updated
Last updated
A list type is an object that can hold a list of other types. When you drag a list onto the canvas, you can populate it with a list of other types.
With a list type you can, for example, make a list of strings, a list of dates, a list of Types or of any other type Linx caters for.
Select the List element type, e.g. String, Bolean, Integer, List, etc
The default value for the variable. This value can contain either Json or Xml.
You can paste a string in the Value property or use the List Editor to add items to your list.
Goes through the List and tests each element against a specific condition. If all of the items in the List satisfies the condition, then returns 'true'. If any item goes against the condition, then returns 'false'.
Returns: Boolean.
[List].All([condition])
Example:
Determines whether a sequence contains any elements.
Syntax:
[list].Any([(optional)condition])
Examples:
Returns a sequence that starts with the given sequence followed by the specified value.
Syntax:
[list].Append([element])
Example:
ListOfPeople.Append(NewPerson)
Computes the average of a sequence of numeric values.
Syntax:
[list].Average([(optional)selector])
Examples:
Joins 2 lists together by adding the second list to the end of the first list. The List types must be the same.
Returns: List. List will be of the same type as the original two, containing all the elements.
[List].Concat([List])
Example:
List1.Concat(List2)
Check whether an item exists inside of the list.
Returns: Boolean - 'true' if List contains the item, 'false' if List does not contain item.
[List].Contains([Item])
Example:
List1.Contains("A")
Returns the number of elements in a sequence.
Syntax:
[list].Count([(optional)condition])
Examples:
Fetch an element at a specific index in the List. Important note, Lists in Linx are zero-indexed, which means the first element in the list is at index 0.
Returns: Generic. Will return the same type that the List is set as. If a List type is String, then ElementAt returns String, if List is a defined Type Person, then ElementAt returns a Person.
[List].ElementAt([Integer])
Example:
List1.ElementAt(2)
Fetch an element at a specific index in the List. Important note, Lists in Linx are zero-indexed, which means the first element in the list is at index 0.
Returns: Generic. Will return the same type that the List is set as. If a List type is String, then [] returns String, if List is a defined Type Person, then [] returns a Person.
[List][[Integer]]
Example:
List1[2]
Fetch an element at a specific index in the List, however if the index is out of the List�s range, then returns a default (which is <NULL> in most cases) without raising an exception.
Important note: Lists in Linx are zero-indexed, which means the first element in the list is at index 0.
Returns: Generic. Will return the same type that the List is set as. If a List type is String, then ElementAt returns String, if List is a defined Type Person, then ElementAt returns a Person.
If the index is out of the List�s range, return�s a <NULL>
[List].ElementAtOrDefault([Integer])
Example:
List1.ElementAtOrDefault(2)
Fetch the first element in a List.
Returns: Generic. Will return the same type that the List is set as. If a List type is String, then First returns String, if List is a defined Type Person, then First returns a Person.
[List].First()
[List].First([(optional)condition])
Example:
Fetch the first element in a List. However, if the List is empty, returns a <NULL> instead of raising an exception.
Returns: Generic. Will return the same type that the List is set as. If a List type is String, then FirstOrDefault returns String, if List is a defined Type Person, then FirstOrDefault returns a Person. If the List is empty, return�s a <NULL>
[List].FirstOrDefault()
[List].FirstOrDefault([(optional)condition])
Example:
Fetch the last element in a List.
Returns: Generic. Will return the same type that the List is set as. If a List type is String, then Last returns String, if List is a defined Type Person, then Last returns a Person.
[List].Last()
[List].Last([(optional)condition])
Example:
Fetch the last element in a List. However, if the List is empty, returns a <NULL> instead of raising an exception.
Returns: Generic. Will return the same type that the List is set as. If a List type is String, then LastOrDefault returns String, if List is a defined Type Person, then LastOrDefault returns a Person. If the List is empty, return�s a <NULL>
[List].LastOrDefault()
[List].LastOrDefault([(optional)condition])
Example:
Returns the maximum value in a sequence of values.
Syntax:
[list].Max([(optional)selector])
Examples:
Returns the minimum value in a sequence of values.
Syntax:
[list].Min([(optional)selector])
Examples:
Order a List using a specific property within the List in ascending order. For Simple types, like String, and Integer, you will still need to define the property to order by. For complex types, for instance, Person, you need to provide the property to order by, for example Name.
Returns: List<Generic>. Will return a List of the same type as the original. For instance if the original List was a List of Strings, then OrderBy returns a List<String>.
[List].OrderBy([selector])
Example:
Order a List using a specific property within the List in descending order. For Simple types, like String, and Integer, you will still need to define the property to order by. For complex types, for instance, Person, you need to provide the property to order by, for example Name.
Returns: List<Generic>. Will return a List of the same type as the original. For instance if the original List was a List of Strings, then OrderBy returns a List<String>.
[List].OrderByDescending([selector])
Example:
Provides the only item in a List. If a list contains no items or more than one, an exception is thrown.
Returns: Generic. Will return the same type that the List is set as. If a List type is String, then Single returns String, if List is a defined Type Person, then Single returns a Person.
[List].Single()
[List].Single([(optional)condition])
Example:
Provides the only item in a List. Returns if the list contains no items, or throws an exception if it contains more than one item.
Returns: Generic. Will return the same type that the List is set as. If a List type is String, then Single returns String, if List is a defined Type Person, then Single returns a Person.
[List].SingleOrDefault()
[List].SingleOrDefault([(optional)condition])
Example:
Provides a List where the first number of items are removed. You provide a number of items to skip.
Returns: List<Generic>. Will return a List of the same type as the original. For instance if the original List was a List of Strings, then Skip returns a List<String>.
[List].Skip([Integer])
Example:
List1.Skip(5)
Provides a sequence that discards items as long as a specified condition is 'true' and then returns the remaining items.
Returns: List<Generic>. Will return a List of the same type as the original. For instance if the original List was a List of Strings, then SkipWhile returns a List<String>.
[List].SkipWhile([condition])
Example:
Computes the sum of a sequence of numeric values.
Syntax:
[list].Sum([(optional)selector])
Examples:
Provides a List of only the first number of items. You provide a number of items to take.
Returns: List<Generic>. Will return a List of the same type as the original. For instance if the original List was a List of Strings, then Take returns a List<String>.
[List].Take([Integer])
Example:
List1.Take(5)
Provides a sequence that relays items as long as a specified condition is 'true' and then discards the remaining items.
Returns: List<Generic>. Will return a List of the same type as the original. For instance if the original List was a List of Strings, then TakeWhile returns a List<String>.
[List].TakeWhile([condition])
Example:
Goes through the List and tests each element against a specific condition, and only taking the elements which satisfies the condition.
Returns: List<Generic>. Will return a List of the same type as the original. For instance if the original List was a List of Strings, then TakeWhile returns a List<String>.
[List].Where([condition])
Example:
Functions that can be performed in the Expression Editor
Use the AddToList function to append values to your list dynamically.
Use the ClearList function to remove all values from a list.