Skip to main content
Version: Next

Last Index Of In List

Gets the index at which the last occurrence of a value in the list

Description

This brick is like Index Of In List except that it iterates over elements of the list from right to left.

The brick is supposed to be used to find the index in the list of primitive types (like string, number, or boolean). If one needs to find the last index in the collection with non-primitive types (e.g. objects) or condition is more complex than just a value, it is recommended to use Find Last In List brick.

Examples:

  • inputs

    • source = [1, 2, 1, 2]
    • value = 2
    • from index = 0
  • outputs

    • result = 3
  • inputs

    • source = [1, 2, 1, 2]
    • value = 2
    • from index = 2
  • outputs

    • result = 2

Inputs

  • Source (Object): The collection to inspect. Could be in the form of List, Array and QueryResult
  • Value (Object): The value to search for
  • From Index (Number): The index to search from

Outputs

  • Index (Number): The found index or -1 if the value wasn't found
  • Error Flow (Error Flow): Triggered by providing unexpected type of the source