> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce Lookup Stored Procedure

> Use a Salesforce stored procedure to look up values and insert them into an Arc message in the flow.

export const DbasaLSPConfiguration = ({datasource = "the data source", siteName = "CData Arc"}) => <>
    <p>Follow these steps to configure a stored procedure:</p>

    <img src="/public/images/dbsa_lsp_config.png" alt="LSP configuration" width="650" />

    <ol>
      <li>Select a stored procedure from the drop-down menu. The available stored procedures depend on the connector and cannot be customized from {siteName}.</li>
      <li>
        <strong>Input Parameter</strong>: Add a <strong>Value</strong> for each input parameter. If you have uploaded a sample file, the editor displays a tree representation of the document so you can easily find the XPath you need, as shown in the following image.
        <img src="/public/images/dbsa_lsp_xpath.png" alt="LSP XPath selection" width="650" />
      </li>
      <li>
        <strong>Output Destination</strong>: select <strong>XPath</strong> to insert the stored procedure response value into an XML file or <strong>Header</strong> to insert the stored procedure response value into a message header.
        <ul>
          <li>XPath: When you choose XPath, the destination is in two parts. The <strong>Parent-Level XPath</strong> should already exist in the XML document. The <strong>New Node Name</strong> is the name of the node that is injected into the XML document to hold the result of the lookup. Each input parameter value has its own XML element (leaf level) in the XML element provided here.</li>
          <li>Header: When you choose Header, the connector adds one header to the output message for each input parameter. The values are comma-separated for each record that is returned from the database.</li>
        </ul>
      </li>
      <li>
        <strong>Output Options</strong>: Stored procedure results might include result sets, return values, and/or output parameters. These two checkboxes let you fine-tune what to include in the output.
        <ul>
          <li>Check <strong>Include Output Parameters</strong> to include the output parameters.</li>
          <li>Check <strong>Include Result Sets</strong> to include result sets in the output (only applicable when the <strong>Output Destination</strong> is XPath). Because multiple results sets with varying structures might be returned, result sets are injected into the input XML with an additional level of hierarchy.</li>
        </ul>
      </li>
      <li>Click <strong>Test Lookup</strong> to see what the structure of the input XML should look like.
        <img src="/public/images/dbsa_lsp_test.png" alt="LSP test" width="700" />
      </li>
      <li>Click <strong>Test</strong> to see what output will be generated. When you are satisfied with the test results, you can click <strong>Save Sample Data</strong> to make the data accessible to other connectors.
        <img src="/public/images/dbsa_lsp_sample.png" alt="LSP sample data" width="700" />
      </li>
    </ol>
  </>;

export const DbasaLSPIntro = ({datasource = "the data source", siteName = "CData Arc", siteNameShort = "Arc"}) => <>
    <p>
      The Lookup Stored Procedure action treats data coming into the {datasource} connector as input
      for stored procedures. The connector executes the selected stored procedure, then inserts the
      resulting values into an existing Arc message in the flow.
    </p>

    <ol>
      <li>In the {siteName} flow, drag an arrow from the connector that will provide input to the {datasource} connector.</li>
      <li>Optionally, choose a <strong>Sample File</strong>. A sample file is recommended because it allows the connector to provide more context about the file structure and makes it easier to select input parameter values.</li>
      <li>Once you have completed the configuration steps below, in the {siteNameShort} flow, drag an arrow from the {datasource} connector to the connector where you want your resulting XML or Header data to go.</li>
    </ol>
  </>;

<DbasaLSPIntro datasource="Salesforce" />

## Lookup Stored Procedure Configuration

<DbasaLSPConfiguration datasource="Salesforce" />
