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
Method Inputs
Method Name
You can give any name. This name will be displayed in the methods list.
e.g.GetSOQLQueryResult
Request Type
GetSOQLQueryResult
Parameters: SQQLQuery
This is a standard Salesforce Object Search language (SOQL) query which you can use in different ways
e.g. SELECT Id, FirstName, LastName,Phone
FROM Contact
WHERE FirstName='John'
and LastName='Bond'
Method Output
Result Type
ListOfRecords (Auto Selected)
It indicates that the method can return one or more records
Record Limit
Numeric value (e.g. 10)
If Method is returning larger number of records, then you can limit this result by providing this value.
Sample Response:
Method Result
Record JsonPath
Each method returns data in json format and to pick any specific information from the json, we need to specify the Record JsonPath so Voice Worx platform will pick that data in consideration while displaying results.
Example: $.[*]
This selects all the records that is returned
Empty Result Template
When the method does not return any data, this response will be generated. So we can specify something like:
“Sorry, I could not find the contact details”
Record Template
"type": "Contact",
"url": "/services/data/v47.0/sobjects/Contact/0032w000002GFOVAA4"
},
"Id": "0032w000002GFOVAA4",
"FirstName": "John",
"LastName": "Bond",
"Phone": "(312) 596-1000"
}
In this example, Phone is at root level and can be accessed by {{Phone}}
So record template can be written as
Phone number of {{FirstName}} {{LastName}} is {{Phone}}
So, when a method is executed, this will be displayed as,
Phone number of John Bond is (312) 596-1000
Note:
Anything written in between {{ }} is represented as a json field and it’s case-sensitive.
{{Phone}} is not same as {{phone}}
Result Template
This indicates how method results should be represented.
Here you go, {{Records}}
Here, {{Records}} represents one or more records separated by a separator.
Last updated