---
sourceDocument: Zurich Customer Service Management
sourceDocumentLink: https://www.servicenow.com/docs/r/zurich/customer-service-management

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich Customer Service Management

ft:clusterId :

    - csm

bundleId :

    - csm

workflow :

    - Customer and Industry


---

# Get Opportunities Details custom action

# Get Opportunities Details custom action {#ariaid-title1}

* Release version: Zurich
* 
* Updated July 31, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The Get Opportunities Details action retrieves a single
Opportunity record from the Salesforce application based on the record Id. This action is
invoked when the user opens the form for the Opportunity record in the remote table.

## Action inputs {#csm-details-opportunities-action__section_cz2_m2z_53b}

The Get Opportunities Details action takes a single integer
parameter that identifies the Salesforce Account ID. This parameter is set by the form based
on the sys_id that was provided to the remote table in the remote table script. For more
information, see [Example
script that queries the Opportunity table](https://www.servicenow.com/docs/wFmTCpuNfc6ZmDFnrxR7XQ "This example script queries the opportunity table using the Get All Opportunities, Get Opportunities for Account Id, and Get Opportunity Details custom actions.").

## Pre-processing step {#csm-details-opportunities-action__section_hrw_m2z_53b}

The pre-processing script step takes the action inputs as its own.

As with other actions, the pre-processing step creates an opportunity query for the
specific parameter. In this case, the match is done against the opportunity record Id. Do
not worry about the LIMIT in this query because it returns at maximum a single record.  

    (function execute(inputs, outputs) {
      
      outputs.query = "query/?q=SELECT+Name,Id,AccountId,CloseDate,Amount," +
                      "StageName,Probability,Type+FROM+Opportunity"         +
                      
                   "+WHERE+Id='" + inputs.salesforce_opportunity_record_id + "'"; 
      
    })(inputs, outputs);

The pre-processing output is a query similar to the other custom actions.

## REST step, post-processing step, and action outputs {#csm-details-opportunities-action__section_j3b_n2z_53b}

These steps and outputs are the same as for the other custom actions except there is no
maximum number of records parameter and no information message.

