Skip to content

arrayIndex of parent arrays in nested array conditions #596

Closed
@joelwkent

Description

@joelwkent

I'm working on a project and have a schema with a 3 level deep array. In the form JSON I want a condition on one of the fields in the nested array. In conditions the only way I know to reference an array element in the model is to use arrayIndex but that is just the index of the inner most array. So the following condition will not work as arrayIndex will only be the correct index for prices[]:

"condition": " model.products[arrayIndex].versions[arrayIndex].prices[arrayIndex].currency == 'USD'"

Is there anyway to perform conditions on nested arrays and reference the nested array element in the model? Something like:

"condition": " model.products[parent.parent.arrayIndex].versions[parent.arrayIndex].prices[arrayIndex].currency == 'USD'"

Any help would be greatly appreciated!!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions