# $join\_parent\_rel

The $join\_parent\_rel function allows you to search for an entity based on its field values as well as its relationship to a parent entity.  This is especially helpful when you want to find all children of a particular entity that meet certain criteria.

#### Example: Find all contacts (char type ID = 2) on a Deal record (record ID = 1234) with a Party ID = 15&#x20;

{% code title="POST: <https://ris.rightsline.com/v3/contact/search>" %}

```javascript
{  
   "query":{  
      "$join_parent_rel":[  
         {  
            "$and":[  
               {  
                  "$eq":[  
                     "parentchartypeid",
                     4
                  ]
               },
               {  
                  "$eq":[  
                     "parentrecordid",
                     1234
                  ]
               },
               {  
                  "$eq":[  
                     "childchartypeid",
                     2
                  ]
               },
               {
                  "$eq":[
                     "relind",
                     15
                     ]
               }
            ]
         }
      ]
   },
   "start":0,
   "rows":25,
   "sortOrders":[  
      "title_sort asc"
   ]
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.rightsline.com/search/search-functions/join-functions/join_parent_rel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
