Displaying location name from organizations lookup table in case list/case detalis

commcare

I referenced locations from my application's organization structure using a multiple choice lookup table and then saved the location as a case property. Now, I want to display the location name in my case list/case details.

By default (Plain format), the location_id field shows up in the case list/case details. Is there a way to display the name of the location in the case list/case details without manually mapping each location ID to its respective name (as you would with the ID Mapping format)?

Best Answer

The best way to do this is to save both the location_id and the location name to the case after your multiple choice question. You can find the expression to get the location name from the location_id here:
https://confluence.dimagi.com/pages/viewpage.action?pageId=38276915

Then, just display the location name in the case list rather than location_id.