I am trying to reference a case property in a follow up form but for some reason the question pulls the case id rather than the case name, how can i fix please?
I need the Group name to show up and not the ID, the same way the Department and Commune are showing up. The group detail is a separate case list though
Hi Jay, what expression are you using which evaluates to the case ID? Regardless, given the ID, you should be able to use this expression to obtain the case name:
I actually wasn't using any expression since i have the group name saved as a case property so i only referened it in the form but then it's picking up the case ID.
That is, I changed Case_Id to @case_id. Your screenshot above includes curly quotes ‘ and ’, which I replaced with simple quotes '. That can sometimes happen if you copy/pasted from a rich text editor like Word or email. The "Lexical error" in your screenshot refers to that issue.
Can you also tell me how i can pull the actual name of the group in the report? Right now in the survey the group name is being properly referenced but when i pull the data into excel or power BI, its the case id thats still showing up.
It looks like that case ID is being saved as the answer to that lookup table question, is that correct? You need a hidden value with the calculate set to:
Thanks so much, this works well. I have also saved it as a case property and pulling that property in subsequent follow up forms so it makes sense to the end users of the data.
Can you also help me with another issue, i have submitted a ticket for it earlier today. It has to do with archiving forms. I archived all the forms in my surveys so that we could test the surveys with fresh data. The archived forms do not show up in a regular form data export but they still show up when i do an excel dashboard report.
That's good to hear. One word of caution about saving the name as a case property. You're saving the name at the time the form is filled out - it's not a reference to the group case's name. This means if the name is later changed, it won't be updated on this case. The alternative is to save the group case ID instead, and look up the name every time. Depends on what's more appropriate for your use-case.
I don't have a good answer to your other question, sorry. Archiving forms is intended to hide them from reports and exports, not sure whether there's a straightforward way around that.
Can you please assist again with this same issue? For some reason, its not working when i try to implement this in another application.
I need to use a multi select to enter all farmers present at a training. If i set the form as a follow up then the user is forced to pick a farmer before entering the form so i decided to set it up as a registration form but i placed an open case condition on it. Any alternative solutions to this method are highly welcome please
When i download the report in excel, the question "select which farmers are present" produces the case ids while the case_name_label does not pull the actual name
You're almost there. it's the same thing as i was explaining to you on the other post.
a multi-select will not return a single value. it'll return a set of caseID's separated by spaces. so, the "=" operator will always not find the exact caseID. it'll always have some other caseID's with it.
so what you want to do is
join(instance(‘casedb’)/casedb/case[selected( #form/farmers_present]/case_name,@case_id)]/case_name,",")
this will return a string of case_names, separated by commas, for the cases selected in farmers_present.
then you save that into a case property that will be available in a case download.
P.S: The correct forum for this type of inquiries is "users" section. The developers section is designed for those who have in-house implementations of CommCare and/or building other software that works WITH commcare. the users space is designed for questions and discussions the community has about building and using CommCare apps and exports.