Filter array using multiple values using formula .where
I have a data array that contain a list of fields. I would like to filter that array using a particular field e.g. status. My formula is:
`data`.where(status: "Completed")
How do I filter the array using more status values? I would like to retrieve a filtered array where status is either "Completed" or "Cancelled"
Best Answer
A
Amanda Wong
said
over 5 years ago
Hi Saul,
Thank you for your question. You can use the formula below to check for multiple status values and retrieve any item in the array that match either status values.
`data`.where(status: ["Completed","Cancelled"])
Answer
Amanda Wong
said
over 5 years ago
Hi Saul,
Thank you for your question. You can use the formula below to check for multiple status values and retrieve any item in the array that match either status values.
Saul Macht
Filter array using multiple values using formula .where
I have a data array that contain a list of fields. I would like to filter that array using a particular field e.g. status. My formula is:
`data`.where(status: "Completed")
How do I filter the array using more status values? I would like to retrieve a filtered array where status is either "Completed" or "Cancelled"
Hi Saul,
Thank you for your question. You can use the formula below to check for multiple status values and retrieve any item in the array that match either status values.
`data`.where(status: ["Completed","Cancelled"])
Amanda Wong
Hi Saul,
Thank you for your question. You can use the formula below to check for multiple status values and retrieve any item in the array that match either status values.
`data`.where(status: ["Completed","Cancelled"])