Using the contact's ID, which is stored in an existing data source, the SOQL subquery selects the IDs of the owners of the cases relating to that ID. The main query returns the ID of the ContactWorld agent who owns the first case. | |
---|
Code Block |
---|
| SELECT NVMContactWorld__NVM_Agent_Id__c
FROM User
WHERE Id IN
(
SELECT OwnerId
FROM Case
WHERE contactID = '$(Contact|ID)'
) LIMIT 1 |
| User|NVM Agent Id |
Using the contact's id, which you have previously retrieved and stored in an existing data source, the SOQL query returns the number of unique open cases. | |
---|
Code Block |
---|
| SELECT COUNT_DISTINCT(CaseNumber)
FROM Case
WHERE
Contact.Id = '$(Contact|Id)' AND
Status != 'Closed' |
| Case|Case Number|Count Distinct |
Using an account's id to get the average opportunity amount
Using the account name, which you have previously retrieved and stored in an existing data source, the SOQL query returns the average time to resolve a case for the account in the last quarter. | |
---|
Code Block |
---|
| SELECT AVG(Amount)
FROM Opportunity
WHERE
Account.Id='$(Account|Id)' |
| Opportunity|Amount|Avg |
|