Dear community, @Gassim greetings from Rwanda, I just wanted to ask a question about multiple select options, now that we know that multiple select is not implemented yet the way I am trying to implement it is to create different data elements with yes only and combine them in one section (this is your suggestion @Gassim thank you it is solving my implementation issue), however now I have the situation that I want your support as you always do,
is there a way we can limit the number of data element to be selected in a given set of data elements with YES Only value type?
ex: we have ten YES only data elements but in selection we don’t want a user to go beyond 5 selections
Hi @Pacifique_Hategekima,
Thanks! I’m glad it worked. Sorry for keeping you waiting! The immediate idea that came into my mind is to count the number of selections. Each time a data element is selected a value of one is added to a Data Element … when this value is greater than the number of allowed data elements, a program rule (or more) hides the data elements that don’t yet have a value.
PR1:
expression: if data-element-1 has value OR data-element-2 OR …
action: add to data-element ‘count’ + 1
PR2 (an option):
expression: if count = ‘a number’
action: hide section
If hiding section is not the best option and you only want to hide the remaining data elements then maybe create several program rules:
PRx:
expression: if data element ‘count’ = ‘a number’ AND data-element-x has no value.
action: hide data-element-x
and so on!
Hope this helps! Will let you know if I have an update. Thanks!
**update:**I predict an issue here, if they select then unselect! Please know I’ve not tried this myself!
Thank you @Gassim I think this can solve the issue, let me try it and the issue of unselect I’m thinking on letting the variable accept negative values then on select I add 1 on unselect I subtract 1, let me check if it can work, thank you
Thanks
Pachat
this also is creating an issue every time I open that event 1 is subtracted…
@Gassim I think I am missing a post here that I thought is interesting, saw it in email, usage of program indicator, yes I can make program indicator that counts number of selection, the problem is how can I use it to limit the number of selections.
You’re welcome! So I was right when I deleted that post Maybe we’ll have to stick to the first option ‘program rule’ and solve the issue when 1 is subtracted when you open the event! (:
I did quietly ask myself but didn’t invesitage … actually, I don’t think we can unfortunately, so maybe if you think this is a great idea to create a discussion in Implementation - Implémentation category and if other members think it’ll be helpful we could create a jira feature request and add our votes!