> For the complete documentation index, see [llms.txt](https://docs.ixhello.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ixhello.com/ixhc/general/edit-custom-apps/methods/data-source-salesforce/getsoqlqueryresult.md).

# GetSOQLQueryResult

GetSOQLQueryResult request type allows you to run Standard Salesforce Object Search Language (SOQL) query against your salesforce objects and fields. It is suitable for complex operations and is basically running your custom queries, getting desired results and then using them as input for your app.

## Method Inputs

| Tab           | Parameter             | Value                                                                                                                                                                                                                                   |
| ------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Method Inputs | Method Name           | <p>You can give any name. This name will be displayed in the methods list.</p><p>e.g.GetSOQLQueryResult</p>                                                                                                                             |
|               | Request Type          | GetSOQLQueryResult                                                                                                                                                                                                                      |
|               | Parameters: SQQLQuery | <p>This is a standard Salesforce Object Search language (SOQL) query which you can use in different ways </p><p>e.g. SELECT Id, FirstName, LastName,Phone</p><p>FROM Contact</p><p>WHERE FirstName='John'</p><p>and LastName='Bond'</p> |

## Method Output

| Parameter    | Info                                                                                                                                          |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Result Type  | <p>ListOfRecords (Auto Selected)</p><p>It indicates that the method can return one or more records</p>                                        |
| Record Limit | <p>Numeric value (e.g. 10)</p><p>If Method is returning larger number of records, then you can limit this result by providing this value.</p> |

#### Sample Response:

```json
// Sample Response
[
 {
 "attributes": {
 "type": "Contact",
 "url": "/services/data/v47.0/sobjects/Contact/0032w000002GFOVAA4"
 },
 "Id": "0032w000002GFOVAA4",
 "FirstName": "John",
 "LastName": "Bond",
 "Phone": "(312) 596-1000"
 }
]
```

## Method Result

| Tab | Parameter             | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| --- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|     | Record JsonPath       | <p>Each method returns data in json format and to pick any specific information from the json, we need to specify the <em>Record JsonPath</em> so Voice Worx platform will pick that data in consideration while displaying results.</p><p>Example: $.\[\*]</p><p>This selects all the records that is returned</p>                                                                                                                                                                                                                                                                                                                                                                                                               |
|     | Empty Result Template | <p>When the method does not return any data, this response will be generated. So we can specify something like:</p><p>“Sorry, I could not find the contact details”</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|     | Record Template       | <p>"type": "Contact",</p><p> "url": "/services/data/v47.0/sobjects/Contact/0032w000002GFOVAA4"</p><p> },</p><p> "Id": "0032w000002GFOVAA4",</p><p> "FirstName": "John",</p><p> "LastName": "Bond",</p><p> "Phone": "(312) 596-1000"</p><p> }</p><p>In this example, Phone is at root level and can be accessed by {{Phone}}</p><p>So record template can be written as</p><p><em>Phone number of {{FirstName}} {{LastName}} is {{Phone}}</em></p><p>So, when a method is executed, this will be displayed as,</p><p><em>Phone number of John Bond is (312) 596-1000</em></p><p>Note:</p><p>Anything written in between {{ }} is represented as a json field and it’s case-sensitive.</p><p>{{Phone}} is not same as {{phone}}</p> |
|     | Result Template       | <p>This indicates how method results should be represented.</p><p>Here you go, {{Records}}</p><p>Here, {{Records}} represents one or more records separated by a separator.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ixhello.com/ixhc/general/edit-custom-apps/methods/data-source-salesforce/getsoqlqueryresult.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
