Access Closed or Date Closed in Form


How can I access the Closed or Date Closed values shown in the case list inside a form? I wanted to use these values to filter closed cases in form reports, not for viewing in the app.

I tried to make a hidden value and call the case property closed, like #case/closed, but it doesn't exist. Is there some other way I can access whether a case is closed in the form?

Thank you so much for your help!

Hi Julia,

Can you talk a bit more about your use-case?

Someone else can probably chime in with a better answer but I'm wondering why you'd wanna check whether a case is closed or not inside a form? As far as I can tell, once a case is closed, we don't allow any further form submissions to it. In other words, the case won't be available on the mobile device(or web apps) once it's closed(unless you are talking about parent-child relationship).

Hi Shivam!

The forms for closed cases are showing up in the form exports, and we want to clean the forms up by only having forms for currently open cases.

The 'closed' value shows up in the case exports, but not in the form exports, so one idea was trying to add the 'closed' value as a hidden value so it could be included in the form export. Thanks!

Ohh, Sorry for the confusion. I think I misunderstood your question earlier.
I see what you're asking now. The form export doesn't have details on whether a case is closed or not.

I'm not fully sure, but I think the export data section might not be of great help here. I think you might wanna look for commcare's data export tool(more info here), you can use that to import both form and case data to a database and then later on write sql queries to filter the forms that belong to open cases.

I might be wrong though and perhaps there might be a simpler solution to your problem, so I'll defer to someone else who has more expertise in this area.