Index Record Type

How to index values from Record Type.

For Example:

how to index location from this 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    As per the index function definition it should accepts the record list for data parameter, however interestingly it does not work.

    index(data, index, default)

    Returns the data[index] if it is valid, else the default value. For example, index({10,20,30},2,1) returns 20 and index({10,20,30},-1,-2) returns -2.

    Returns: List

    data (Any Type): A homogeneous array, whose indexed value is expected. Can also be a dictionary, map, CDT, or Record.

    index (Any Type): The index or array of indices of the data. Index can be an integer, text, or a Record Type Field Reference.

    default (Any Type): The default value to be returned if the data or the index is invalid, e.g. if the data itself is empty or the index is not found in the data. The type of the default value must be same as that of elements of the data.

Reply
  • 0
    Certified Lead Developer

    As per the index function definition it should accepts the record list for data parameter, however interestingly it does not work.

    index(data, index, default)

    Returns the data[index] if it is valid, else the default value. For example, index({10,20,30},2,1) returns 20 and index({10,20,30},-1,-2) returns -2.

    Returns: List

    data (Any Type): A homogeneous array, whose indexed value is expected. Can also be a dictionary, map, CDT, or Record.

    index (Any Type): The index or array of indices of the data. Index can be an integer, text, or a Record Type Field Reference.

    default (Any Type): The default value to be returned if the data or the index is invalid, e.g. if the data itself is empty or the index is not found in the data. The type of the default value must be same as that of elements of the data.

Children
No Data