# Need 3 constraint support

**URL:** <https://forum.getodk.org/t/need-3-constraint-support/32751>\
**Category:** Support\
**Tags:** odk-xlsform-offline, odk-collect, form-design, odk-xlsform\
**Created:** [March 11, 2021, 8:29am UTC](https://forum.getodk.org/t/need-3-constraint-support/32751 "2021-03-11T08:29:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glen.Poresh](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/glen.poresh/32/14575_2.png) [@Glen.Poresh](https://forum.getodk.org/u/Glen.Poresh)\
**Post date:** [March 11, 2021, 8:29am UTC](https://forum.getodk.org/t/need-3-constraint-support/32751/1 "2021-03-11T08:29:30Z")

</div>

Hi Odk community need a support from you guys.

So we need 3 conditions here to be met:

1. not selected that there was no door and selected that the frame was used for the door;
2. not selected that there was no roof and selected that the frame was used for the roof;
3. not selected a response option and selected "no"

recently i did this one "not(selected(${lat\_door},'no') and selected(., 'yes\_door')) and not(selected(., 'no') and not(selected(${lat\_roof},'no') and selected(., 'yes\_roof') and count-selected(.) \> 1))"

but its not working.  
your help will be really apricated.  
thanks

[Infra\_quality\_latrine.xlsx](https://forum.getodk.org/uploads/short-url/yUJyvTQMa7vrenma5pbXdE7Vrtc.xlsx) (17.9 KB)

---

<div class="post-metadata">

**Author:** ![jpringle](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/jpringle/32/14685_2.png) [@jpringle](https://forum.getodk.org/u/jpringle)\
**Post date:** [March 11, 2021, 4:07pm UTC](https://forum.getodk.org/t/need-3-constraint-support/32751/2 "2021-03-11T16:07:41Z")

</div>

> [@Glen.Poresh](#):
>
> recently i did this one "not(selected(${lat\_door},'no') and selected(., 'yes\_door')) and not(selected(., 'no') and not(selected(${lat\_roof},'no') and selected(., 'yes\_roof') and count-selected(.) \> 1))"

That is close. The first two conditions are correct:

`not(selected(${lat_door},'no') and selected(., 'yes_door')) and not(selected(., 'no') and not(selected(${lat_roof},'no')`

The third and final condition should be `not(selected(., 'no') and count-selected(.) > 1)`, so that it is not the case that "No" is selected and there is more than one item selected. All together, it is:

```auto
not(selected(${lat_door},'no') and selected(., 'yes_door')) and not(selected(., 'no') and not(selected(${lat_roof},'no') and not(selected(., 'no') and count-selected(.) > 1)

```
