Skip to main content
November 23, 2022
Solved

Index Record Type

  • November 23, 2022
  • 5 replies
  • 0 views

How to index values from Record Type.

For Example:

how to index location from this 

    Best answer by amans0009

    record types are indexed using square brackets

    first way - index(local!allUsers, recordType!yourRecordName.fields.yourField, {})
    second way - local!allUsers[recordType!yourRecordName.fields.yourField]
    

    5 replies

    stefanhelzle0001
    Brainy
    November 23, 2022
    amans0009
    amans0009Answer
    November 23, 2022

    record types are indexed using square brackets

    first way - index(local!allUsers, recordType!yourRecordName.fields.yourField, {})
    second way - local!allUsers[recordType!yourRecordName.fields.yourField]
    

    November 23, 2022

    Thank You

    abhayd3663
    February 12, 2023

    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.