# Error with choice\_filter and images in options

**URL:** <https://forum.communityhealthtoolkit.org/t/error-with-choice-filter-and-images-in-options/4692>\
**Category:** Technical Support\
**Created:** [February 26, 2025, 4:20pm UTC](https://forum.communityhealthtoolkit.org/t/error-with-choice-filter-and-images-in-options/4692 "2025-02-26T16:20:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![delcroip](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/delcroip/32/1568_2.png) [@delcroip](https://forum.communityhealthtoolkit.org/u/delcroip)\
**Post date:** [February 26, 2025, 4:20pm UTC](https://forum.communityhealthtoolkit.org/t/error-with-choice-filter-and-images-in-options/4692/1 "2025-02-26T16:20:26Z")

</div>

We have a select with choice having image  
on that select we have a choice filter like

`string-length(choice_filter)=0 or (choice_filter='bf1cb2809ae0' and ${CHE.B14S2.DE11A}>0) or (choice_filter='6f8b1750b6b7' and ${CHE.B14S2.DE11A}>0 and ${CHE.B14S2.DE012}>0) or (choice_filter='73acb6bc483d' and ${CHE.B14S2.DE10}>0)`

if “DOM” element change don’t result to an update of the filtered choice then the image are not displayed, but if it happens once then the image are staying

the image appear only if :

- CHE.B14S2.DE10 is set to 1
- CHE.B14S2.DE11A is set to 1

but the image are not appearing if CHE.B14S2.DE012 is set to 1 (with the 2 previous set to 0 or not set at all)

it is really weird and annoying, any idea on how to overcome that ?

br

---

<div class="post-metadata">

**Author:** ![delcroip](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/delcroip/32/1568_2.png) [@delcroip](https://forum.communityhealthtoolkit.org/u/delcroip)\
**Post date:** [February 26, 2025, 9:21pm UTC](https://forum.communityhealthtoolkit.org/t/error-with-choice-filter-and-images-in-options/4692/2 "2025-02-26T21:21:02Z")

</div>

I manage to get it work using a silly work-arround: I am injecting the select relevance (coalesce(${CHE.B14S2.DE012},‘’)!=‘’) next to string-length therefore, having the question display enforce recalculation of the choice list to display

```auto
(coalesce(${CHE.B14S2.DE012},'')!='' and string-length(choice_filter)=0) or (choice_filter='bf1cb2809ae0' and ${CHE.B14S2.DE11A}>0) or (choice_filter='6f8b1750b6b7' and ${CHE.B14S2.DE11A}>0 and ${CHE.B14S2.DE012}>0) or (choice_filter='73acb6bc483d' and ${CHE.B14S2.DE10}>0)

```

Note: This is generated by our tooling TRICC, this kind of filter can seem odd but we are actually defining relevance on the choice level and the TRICC create that choice\_filter to make it work on CHT/ODK that only support “xpath expression” on the select level, TRICC also add the hash of the choice relevance in the choice 'choice\_filter (ex: `73acb6bc483d` is the hash of `${CHE.B14S2.DE10}>0`)
