Organizations Troubleshooting & FAQs
Troubleshooting – Organizations in CommCare
Here are some common issues users face when working with Organizations in CommCare and how to resolve them.
Common Issues and Solutions
Common Issue 1: Case Sharing Errors When Using Organizations
Issue: Users experience case-sharing errors, preventing proper access and workflow functionality.
Cause: Many users assume that Organizations and Case Sharing are separate features. However, Organizations is an advanced version of Case Sharing, meaning Case Sharing must be enabled for Organizations to function correctly.
Solution: Always enable Case Sharing in the app settings when using Organizations. This ensures seamless case ownership and prevents errors related to case access and sharing. Ensure mobile workers are only ever assigned to either a Case Sharing Group or a Location – not both!
Always save the case ownership related questions to the case properties, like owner_id etc so it can assign the case ownership to the other user when needed.
Common Issue 2: Organizational Structure Not Working Across Applications
Issue: The Organizations feature is not functioning as expected across multiple applications within the same project space.
Cause: The organizational structure is set at the project space level, not the application level. If multiple applications within a project space need to use the Organizations feature, lack of coordination among application owners can lead to conflicts or an unusable structure.
Solution: Application owners (App editors) must collaborate to ensure that the organizational structure is designed to support all applications within the project space. This prevents inconsistencies and ensures seamless case ownership and workflow management.
Common Issue 2: Cases Are Not Owned by Organizations
Issue: Cases are being assigned to individual users instead of organizations, causing issues with case ownership and access.
Cause: In forms that register cases, the application must be explicitly configured to assign ownership to organizations/locations rather than individual users. If this step is missed, cases may not be accessible to the correct groups or workflows.
Solution: Ensure that in any form registering cases, case ownership is set to organizations. When in doubt, create a hidden value in your registration form to instruct CommCare to assign the case to the user’s location. This allows proper case management, visibility, and workflow functionality within the Organizations feature.
Make sure that no same users are in case sharing group and in a location too.
Common Issue 3: Difficulty Identifying the Case Owner
Issue: Cases are not properly linked to an organization, making it challenging to determine ownership and manage access.
Cause: Unlike case sharing groups, assigning cases to organizations requires explicitly setting the ‘owner_id’ in the registration form. If this is not configured, it will be hard to find the assigned correct organization, leading to workflow disruptions.
Solution: To ensure proper ownership, add a hidden value question in the registration form to define the 'owner_id', assign cases to the appropriate organization, and save it to the case property. This allows for better case management and visibility within the Organizations feature.
Common Issue 4: Case Ownership Errors When Users Are Assigned to Multiple Locations
Issue: Users assigned to multiple locations encounter case-sharing errors, preventing proper case access and workflow functionality.
Cause: If owner_id is not manually defined in every form where cases are created, cases may not be consistently assigned to the correct location, leading to ownership conflicts. This is especially important when a user belongs to multiple locations.
Solution:
In every form, include owner_id as a hidden value and set it as a case property.
For follow-up forms, set the case property to the pre-existing owner_id to maintain consistency.
While this step may seem unnecessary, skipping it can result in case-sharing errors, so it's essential for smooth case management.
Common Issue 5: Location Name Not Displayed in Case Data
Issue: Users expect to see the location name but only find the location ID stored in CommCare.
Cause: CommCare stores location IDs by default, not location names. Many users assume the name will be saved automatically, leading to confusion when reviewing case data.
Solution: If the location name is needed, store it separately by adding a hidden value question in the form that references the location hierarchy to get the location name (instance('locations')/locations/location[@id = instance('commcaresession')/session/user/data/commcare_location_id]/name
). This ensures both the location ID and location name are available for reference. We highly recommend following this best practice for clarity in case management.
Common Issue 6: App Performance Issues Due to Extensive Use of Advanced Location Features
Issue: The mobile application is running slowly due to extensive references to the organizational structure
Cause: Overloading the app with complex location-based logic such as complicated Xpath statements in large organizational hierarchies can lead to application slowness
Solution: Limit the use of complicated Xpath statements that you have in your application, and always optimize Xpath statements so they run as efficiently as possible. Make your organizational hierarchy as small as possible, so that users have only the locations they need stored on their devices.
Common Issue 7: App Performance Issues Due to Number of Cases at a Location
Issue: The mobile application is running slowly due to large case loads at a location
Cause: Assigning too many cases to one location (as can easily be done when case sharing among a large group) can lead to large caseloads that the mobile device cannot handle. Application slowness or crashes can occur.
Solution: Limit the amount of cases that can be assigned to any one location. Ensure that the case sharing setup your project employs will not go over this limit. Conduct performance testing on your application to ensure your app can perform well at the caseloads you anticipate having.
Frequently Asked Questions (FAQs) – Organizations in CommCare
1. Why is my application not recognizing the organizational structure I set up?
Answer: The organizational structure is defined at the project space level, not at the application level. If multiple applications in a project space need to use Organizations, application owners must coordinate to ensure the structure is properly configured and compatible with all apps.
2. Why are cases being assigned to users instead of organizations?
Answer: In any form that registers cases, you must explicitly assign case ownership to organizations by setting the owner_id to the relevant organization. If this step is missed, cases default to being owned by individual users.
3. How do I ensure that cases are assigned correctly to organizations?
Answer: In the case registration form, include a hidden value question to define the owner_id and set it to the organization. Unlike case-sharing groups, Organizations require this manual configuration to function correctly.
4. I have a user assigned to multiple locations. How do I prevent case-sharing errors?
Answer: Every form must include owner_id as a hidden value and set it as a case property. For follow-up forms, set the case property to the pre-existing owner_id to maintain case ownership consistency and prevent errors.
5. Why do I see location IDs instead of location names in my case data?
Answer: CommCare stores location IDs by default, not names. If you need the location name, store it separately by adding a hidden value question in your form. This best practice ensures both the ID and name are available for reference.
6. Can I assign cases to multiple locations?
Answer: While CommCare supports advanced location features, assigning cases to multiple locations can create performance and scalability issues. Instead, use the "Reassign Cases" feature for better data management and smoother case workflows.
7. Do I need to enable Case Sharing when using Organizations?
Answer: Yes. Organizations is an advanced version of Case Sharing, so Case Sharing must be enabled in your application settings for Organizations to work properly. Without this, case-sharing errors may occur.
8. Can my users be assigned to both Case Sharing Groups and Organizations?
Answer: No. Organizations is an advanced version of Case Sharing, so either case sharing groups or organizations should be used: not both.