---
title: "feature request: idm:match(attribute, list_of_values)"
url: "https://openforis.support/questions/3141/feature-request-idmmatchattribute-list_of_values"
tags: ["collect"]
status: "accepted"
score: 0
answer_count: 1
asked: "2021-05-20T07:41:54"
last_activity: "2021-06-04T09:23:13"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# feature request: idm:match(attribute, list_of_values)

Asked by Andras on 2021-05-20

Hi,

This function would be complementing function to idm:contains. My argument for the request is when a code list attribute needs to be checked e.g. to define relevancy of an other attribute this function could significantly reduce the length of the expression in certain cases.

E.g. codes are running from 1 to 10 and relevancy would be true if say codes are one of 2,4,6,9. In R the expression would look like `code_list_a%in%c(2,4,6,9)`. In Collect, to my understanding, I have to write `code_list_a = 2 or code_list_a = 4 ...`.

Please let me know if I have missed some new feature and this is already possible.

I really think this would be a nice improvement, but I know how busy you guys are.
Congrats on version 4, I've just started to use it to create a field survey :)

Thanks!


## Accepted answer (score 1, by Stefano (OF) on 2021-06-04)

Link: https://openforis.support/questions/3141/feature-request-idmmatchattribute-list_of_values/3157

Dear Andras,  
Sorry for the late reply.  
In Collect there is a function you can use in this case: `idm:contains`  
It takes 2 arguments: a list of values and the value you want to test.  
As list of values you can specify an array of fixed values or the name of a multiple code attribute or a "node set", for example `multiple_entity_name/code_attribute_name`.  
In your case the expression would be something like this: `idm:contains(idm:array(2,4,6,9), code_list_a)`   
Thanks,  
Open Foris Team
