feature request: idm:match(attribute, list_of_values)

  • Asked
  • Active
  • Viewed 1898 times
0

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!

1

Accepted answer

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

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.