Filtering children case list

hi,
i want to add filter to my child case list using a parent case in the filter is that possible?

for example (it is a silly one) i want to filter all child cases whom their age is lower than their parents age.

Hi Asim

since you’re using parent/child cases. you should be able to do this pretty easily

just click on the caselist menu item in your application designer, and then go to the caselist tab

in the bottom, you’ll find this checkbox
image

make sure it’s selected (true) and the application will then ask you to select the parent case first, then show you its children

depending on where you’re making that filter, you may or may not be able accomplish things this way.

come to think of it, it might even make your application slower if it’s going to apply filters on multiple levels.

perhaps what you can do for this, is to run a hidden calculation in one of your forms (for example on the child case) you can have a flag that’s set to “true” when the age entered is lower than the parent case’s attribute and then filter for that. or to have the parent case have a flag that’s set to true, and then if a child case is entered and they have a higher age, you update the parent case property to false.

basically, this means running that “child age > parent age” calculation at the time of data entry, rather than during a case list filter because it means it will run once per line of data, vs running potentially thousands of times every time you use that filter. this way, your filter is very simple (fieldname = true)

HTH

Mazz

thanks for your reply, i am aware of how to do filter and the steps to it but whenever i try to compare a child case property to a parent case property i am getting an error of invalid or an empty case list.
this is what i wrote:
child_sessions(which it is a child property)>group_sessions(which is a parent property)

but i am getting error or an empty caselist

Ok, so you’re trying to load a caselist.

i imagine that the parent and child cases are different case types.

if so, i’m going to assume that the cases you’re trying to see are the child cases.

what you’re trying to say is: myproperty < my parent’s property.

this can’t happen on the case list level i believe. if so, i’d be very interested in learning how to do that myself.

but there is a really quick and easy workaround (you will have to update existing cases for this work).
take the parent property for age and put in a hidden value on the child case and call it something like “parent_age”
in your filter, just put myage > parent age and you should be getting the desired result

but you have to update your existing child cases otherwise it nothing will show up. (any value is greater than null)

HTH

this is exactly what i want to do and i dont know how, i can upload the parent data in my child data in a hidden value but as you said the form need to be submitted each time so if it was filtered out, i will not be able to submit it again.
so i need to compare the child data with a parent data to be able to appear again which i am trying to do but i am not being able to find out till now.

Hi Asim

check this out