@p15himanshus (P15himanshus) posted a new topic, subject "Creating filtering criteria on search button". It read:

   Hello All
    
    I am trying to create an online obituary. Here anyone can create sign up and then create obituary pages for various persons. People can come and comment on the obituary and leave the memories of that person.
    
    I have three types of data:
    
      1. User: The user who logs in
      2. Obituary Page: The page on which the obituary of the person is dispayed created by the user.
      3. Memory: The comments shared by other users
    
    
    
    Memory snippet.PNG879×392 12.5 KB
    
    Page snippet.PNG877×522 18.8 KB
    
    User.PNG825×503 18.4 KB
    
    I have attached the field types for various data types here.
    
    **Problem** : I am unable to create a repeating group on the obituary page which will filter the memories/(comments) **created for the particular person for whom the obituary is made**
    
    Workflow.PNG814×619 27.1 KB
    
    Please help me.
    
    Thanks in Advance

@jakubdab (Jakubdab) replied

    > created for the particular person for whom the obituary is made
    
    At the first glance - rethink your data structure.
    
      * Users [people, who can register, create Obituaries and leave Memories]: leave it standard at the moment
      * Obituary [i avoid using Page on purpose; this is actually the “Person” for whom the obituary is created]: title, description(?), name_of_person (?), date of birth(?), date of death(?), etc + standard fields: creator, created on, modified on
      * Memory [this is the comment for specific person's obituary]: title(?), tribute, obituary (type of Obituary) + standard fields: creator, created on, modified on
    
    
    
    Logic behind that is:
    
      * User can create many Obituaries
      * User can write many Memories
      * Each memory belongs to one Obituary
    
    
    
    and this is enough to have Bubble make all necessary connections.
    
    Now for the RepeatingGroup memory on the page of Obituary do search for Memory, which “obituary” attribute is the Obituary thing (eg. passed as argument to a Bubble page for obituaries).
    
    Here working version:  
    https://obiwan.bubbleapps.io/version-test/obituary_index
    
    on page index - when text is clicked on repeating group of Obituaries  
    
    
    obiwan_-_Bubble_Editor_-_2018-01-01_18.45.42.png687×512 22.3 KB
    
    how page obituary_page is configured - just type of content set to Obituary  
    
    
    obiwan_-_Bubble_Editor_-_2018-01-01_18.42.42.png1192×774 32.4 KB
    
    how search is made on obituary_page for RepeatingGroup memory  
    
    
    obiwan_-_Bubble_Editor_-_2018-01-01_18.43.04.png1192×774 36.3 KB

@jakubdab (Jakubdab) replied

    See the source  
    https://bubble.io/page?type=page&name=obituary_index&id=obiwan
    
      * 2 pages: obituary_index and obituary_page
      * 1 workflow on the obituary_index
      * data structure: memory, user, obituary

To which @p15himanshus (P15himanshus) replied

    Thanks,
    
    I will try it on my app

So @p15himanshus (P15himanshus) replied

    Thanks. It is working on my App. However, I would like to know that why you created a field: ‘obituary' type: obituary in data type: Memory. Can you explain me that as I have little experience to coding. It would go a long way in organizing the data structure in my app

To which @jakubdab (Jakubdab) replied

    jakubdab:
    
    > Logic behind that is:
    > 
    >   * User can create many Obituaries
    >   * User can write many Memories
    >   * Each memory belongs to one Obituary
    > 
    
    
    The last point explains it.  
    You need a connection field between Obituary and Memory to find appropriate tributes and display them on the appropriate obituary page.
    
    In your 1st solution you put Memory field into User, Page into Memory, Memory into Page on data structure. That translates more or less to:
    
      * one User has one Memory
      * one Page has one Memory
      * one Memory has one Page
    
    
    
    which doesn't make any sense for what you want to achieve.  
    It could still work though, with removing Memory from user and changing Memory in Page to List. Then you would need to add items to list in a workflow, and in search use “contains” constraint. But, depending on your needs, that is bit more complex.

@p15himanshus (P15himanshus) replied

    Thanks a lot. it helped

So @system (system) replied

    This topic was automatically closed after 70 days. New replies are no longer allowed.


{'source': 'discourse', 'url': 'https://forum.bubble.io/t/creating-filtering-criteria-on-search-button/22345', 'title': 'Creating filtering criteria on search button', 'views': 1066, 'has_accepted_answer': True, 'word_count': 673, 'like_count': 1, 'reply_count': 7, 'participant_count': 2, 'posts': 8, 'tags': '', 'author': '@p15himanshus (P15himanshus)', 'participants': '@p15himanshus (P15himanshus), @jakubdab (Jakubdab), @system (system)', 'image_url': ['https://forum.bubble.io/uploads/default/original/3X/a/a/aae378e8e2534661e9e0ebb5c53ed9562526d738.PNG'], 'created_at': '2018-01-01T16:30:31.490Z', 'last_posted_at': '2018-03-12T16:41:49.920Z'}