---
title: "Checks for multiple code attributes not working properly on Collect Mobile"
url: "https://openforis.support/questions/3542/checks-for-multiple-code-attributes-not-working-properly-on-collect-mobile"
tags: ["collectmobile"]
status: "answered"
score: 0
answer_count: 2
asked: "2023-01-18T08:03:34"
last_activity: "2023-01-24T15:00:54"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# Checks for multiple code attributes not working properly on Collect Mobile

Asked by chris_1123 on 2023-01-18

Dear OF team

In our survey we have a multiple code attribute for selecting team members. In minimum there must be two team members, in maximum there three.

Therefore, we have an `attribute team`, where we have checked `Multiple` with `Min count: 2`, `Max count: 3`. In OF Collect Desktop, the validation of the restrictions works as supposed. However, in OF Collect Mobile there seems to be a bug for the validation.  

I have tested the following cases:  
<table>
  <tr>
    <th>Min count</th>
    <th>Max count</th>
    <th>validation min</th>
    <th>validation max</th>    
  </tr>
  <tr>
    <td>2</td>
    <td>3</td>
    <td>error warning only disappears after selecting-unselecting-selecting some items.</td>
    <td>not working</td>    
  </tr>
  <tr>
    <td>0</td>
    <td>3</td>
    <td>no error if `NULL`</td>
    <td>not working</td>    
  </tr>
  <tr>
    <td>`NULL`</td>
    <td>3</td>
    <td>`NA`</td>
    <td>not working</td>    
  </tr>
</table>  
<br>
Best,  
Christoph


## Answer (score 0, by Stefano (OF) on 2023-01-18)

Link: https://openforis.support/questions/3542/checks-for-multiple-code-attributes-not-working-properly-on-collect-mobile/3547

Dear Christoph,  
We will investigate this issue and apply a fix in the next version of Collect Mobile if necessary.  
Many thanks,  
Open Foris Team


## Answer (score 0, by chris_1123 on 2023-01-24)

Link: https://openforis.support/questions/3542/checks-for-multiple-code-attributes-not-working-properly-on-collect-mobile/3551

There is a way I have achieved to suppress this warning for the example above: I have an entity `plot/team_sampling_decision` where I select the field-crew members (code-attribute `team`):   

 - check `Multiple` as described above  
 - add additional checks for min and max:  
**min:** `count(parent()/team_sampling_decision/team) >= 2 and idm:not-blank($this)`   
**max:** `count(parent()/team_sampling_decision/team) <= 3`  

Note that the argument `idm:not-blank` is required since no error would be raised if no team-members are selected.  

This solution currently works (Collect Mobile Version 1.7.9 [206]), but I don't know if there might happen unforeseen interactions of this double-validation in future versions...
