Conditional filtering repeating group

I have a repeating group that displays data type ‘Question’. ‘Question’ includes fields ‘marks’, ‘difficulty’ etc which are all numeric values. I have had no problem filtering these questions using sliders for each of these values.

I have checkbox - when checked, I want to add an additional constraint on field ‘attempted’ to this repeating group. So, when it is unchecked, we don’t include this constraint, and when it is checked, we do include this constraint.

How does this work? Thanks!

1 Like

Hi there, @georgecollier… one way you can do what you described is to use the An input’s value is changed workflow event to change the data source of the repeating group when the checkbox is checked and unchecked. So, something like the following for when the checkbox is checked, and you would have a similar workflow event for when the checkbox is unchecked.

You could also set a custom state when the checkbox is checked and unchecked, and you could conditionally change the data source of the repeating group to include/exclude the attempted constraint based on the value of the custom state.

Anyway, you’ve got some options here, and I hope this helps.

Best…
Mike

Hey Mike, thanks for your response.

The checkbox status is saved as part of a ‘user settings’ data type rather than a state, so that it is persistent. So, most of the time, the user will load the page, and the checkbox will be either checked or unchecked, without any user interaction. How can I integrate this into the method you described?

Okay, if I understand correctly, I believe you can just use a conditional on the repeating group to change the data source and add the additional constraint when the current user’s user setting’s attempted is yes. So, maybe something like this.

1 Like

Perfect, I assume there’s no simple workaround if I have multiple checkboxes for different states, I’ll just have to add the possible combinations as conditions?

1 Like

If I knew more about your app, we might be able to come up with something, but probably not. If you’ve got different states, then it’s all about changing the data source based on those states, and multiple conditions or workflow events will be involved.

1 Like

Is there a way that I can chain conditions or workflows, for example:

  1. Search for all questions
  2. Search for questions in previous step that have ‘attempted’ as ‘yes’
  3. Search for questions in previous step that have x
  4. Search for questions in previous step that have y
  5. Search for questions in previous step that have y
    N. Display final list of questions in the repeating group

So, the workflow would act kind of like a funnel, narrowing down on the final list.

My solution here for anyone who finds this thread:

Whenever any of the input slider/checkbox/toggles are changed, search for all possible questions, and gradually filter out things which do not meet one of the conditions. Finally, sort by difficulty or marks depending on which value the toggle is set to.

1 Like