Skip to content

$indexOf function for array enhancement request #187

@wnm3

Description

@wnm3

I wanted to leverage the location of elements in an array to do something, but couldn't figure out how to get the index of a particular array element matching search criteria. I would like to see something like:

$indexOf(Account.Order[OrderID="order103"])
or
Account.Order.indexOf(OrderID="order103")
or
Account.Order[OrderID="order103"].index

Above are listed in order of preference but would be happy with any of them.
Also posted here if you'd prefer I just use a function:
https://stackoverflow.com/questions/49655474/how-to-get-index-of-element-in-array-in-jsonata

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions