Technical question on using primary filters to create cascading select in EspoCRM

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DGorsse
    Junior Member
    • Jan 2025
    • 6

    #1

    Technical question on using primary filters to create cascading select in EspoCRM

    For the data management system for a humanitarian use case in Morocco (and very likely in the future for other humanitarian use cases too), we are encountering the challenge of implementing cascading select in EspoCRM. We need support to figure out a (potential) new way to do this.

    There are two different use cases for this:
    1. Coding framework with Types, Categories and Codes. For the Morocco use case, this is a double nested framework with around 7 Types, around 5 Categories per Type, and around 6 Codes per Category. So in total around 200 codes on lowest level.
    2. Location-related information with Regions, Provinces and Communes which works in a similar nested structure/hierarchy.
    There are multiple ways to try to implement such a functionality: 1) list all the options in three separate fields (not really cascading select and this will leave the user with huge lists; 2) hardcode all the second and third level options as field and use skiplogic to hide (this is cascading select, but you will have to create many fields and many logic); 3) using an entity-approach with primary filters.

    How the last one could probably/hopefully work:
    1. create an entity per level (so in total 3 new entities)
    2. link the 3 level entities in a nested structure (how? upper to lower level; one to many respectively; e.g. one Type record contains many Categories etc.)
    3. link the 3 level entities to the main entity
    4. add records to the entity level 1 (e.g. for 'type': complaints, questions and observations etc.)
    5. add records to entity level 2 which are related to a record of entity level 1 (e.g. for type='question': question about registration, question about distribution etc.)
    6. add records to entity level 3 which are related to a record of entity level 2 (e.g. for category='question about registration': question on where to register, question on when I can register etc.)
    7. UX: create a record of the the main entity and fill in the following on the detail page:
      1. select a record under type
      2. select a record under category (which only shows the records related to what has been selected under type earlier, using a primary (automatically pre-set) filter
      3. select a record under topic (which only shows the records related to what has been selected under category earlier, using a primary (automatically pre-set) filter
    The main question here is how to make this work with a primary filter. What would be the change to be made in the backend so that the above steps 7.2 and 7.3 can show a subselection only of the categories and topics?

    Please let me know if a more visual description would help next to this written explanation. The goal is to duplicate the cascading select functionality from KoboToolbox within EspoCRM, to avoid selecting from a large lists of options for users.

    Below screenshots give an idea of the type, category and code on the detail layout (screenshot 1). Upon selecting 'questions' as Type, the categories should show a subset of the category options which relate to the earlier inputted Type 'questions' (screenshot 2)
    Click image for larger version

Name:	image.png
Views:	0
Size:	36.4 KB
ID:	117616
    Click image for larger version

Name:	image.png
Views:	0
Size:	83.3 KB
ID:	117617
    In the attachment there is also the extension that can be uploaded to simulate the above. ​
    Attached Files
Working...