---
sourceDocument: Brazil Sales Customer Relationship Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/order-management

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Sales Customer Relationship Management

ft:clusterId :

    - omgmt

bundleId :

    - omgmt

workflow :

    - Customer and Industry


---

# ServiceNow Quote Experience Integrate Salesforce approvals

# ServiceNow Quote Experience Integrate Salesforce approvals {#ariaid-title1}

Release version: Brazil  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 7 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of ServiceNow Quote Experience Integrate Salesforce approvals

This guide explains how to integrate Salesforce approval processes within ServiceNow Quote Experience, enabling automated and streamlined approval workflows between the two platforms.
It covers setting up Salesforce approval processes, creating integrations for communication, configuring ServiceNow Quote Experience for approval actions, and deploying related Apex code and flows in Salesforce.
Show full answer Show less  

## Salesforce Setup

* Create an approval process in Salesforce for the Opportunity transaction record, defining approval steps and automated actions (field updates, notifications) based on approval outcomes.
* Create a custom picklist field on the transaction record with values for Pending Approval, Approved, and Rejected to track approval status.
* Configure initial submission, approval, and rejection actions to update this custom field and optionally trigger email alerts.
* Activate the approval process and ensure CORS settings include necessary URLs for ServiceNow integration.

## ServiceNow Quote Experience Integrations

* Create two sequential integrations: one to fetch the Salesforce record ID based on a transaction UUID, and another to submit the record for approval using Salesforce REST API endpoints.
* Configure request and response transformations to map Salesforce data to ServiceNow transaction fields.
* Set up additional events in ServiceNow Quote Experience to handle advancing or revising the approval stage, linking these to button events and layout configurations.
* Add a "Submit for Approval" button to the draft transaction layout and include the Salesforce record ID as a read-only field for reference.

## Salesforce Flow and Apex Code

* Create a record-triggered flow in Salesforce that monitors changes to the custom approval status field and runs asynchronously when updated.
* Use decision blocks within the flow to handle approved or rejected statuses and invoke Apex actions accordingly.
* Deploy an Apex class that performs API callouts to ServiceNow endpoints to transition transaction stages based on approval outcomes.
* Manage deployment through Salesforce CLI with a manifest file specifying the Apex class.

## Testing and Debugging

* After setup, test the approval process end-to-end by submitting transactions from ServiceNow and verifying status updates in Salesforce.
* Use provided SOQL queries to retrieve the most recent approval process instance status for debugging purposes.

## Practical Benefits for ServiceNow Customers

This integration allows ServiceNow customers to leverage Salesforce's native approval processes directly within the ServiceNow Quote Experience, ensuring consistent, automated approval workflows that reduce manual effort and increase process visibility. Customers can expect seamless status synchronization between platforms, real-time approval submissions, and enhanced control over transaction approval lifecycles.  
Integrate Salesforce approvals into ServiceNow Quote ExperienceServiceNow Quote Experience.
![Menu]()

## Salesforce setup {#transaction-manager-integrate-salesforce-approvals__Salesforce-Setup}

Refer to these Salesforce Trailheads modules and documentation:

* Postman: [Quick Start: Connect Postman to Salesforce](https://trailhead.salesforce.com/content/learn/projects/quick-start-connect-postman-to-salesforce)
* Submit for Approval: [Salesforce Developers: Submit a Record for Approval](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_process_approvals_submit.htm)
{#transaction-manager-integrate-salesforce-approvals__ul_ovp_h1l_hhc}  
An approval process in Salesforce automates record approval workflows in an organization. It defines:

* Approval Steps: The sequence of steps and approvers for a record, for example, sending a time-off request to an employee's manager for approval.
* Actions: Automated actions based on the approval outcome, such as updating records if approved or sending notifications if rejected.
{#transaction-manager-integrate-salesforce-approvals__ul_ibv_k1l_hhc}

This streamlines the approval process and ensures consistency.

1. Go to Setup, click Approval Processes, and select the transaction record.
2. In Manage Approval Processes For, select Opportunity.
3. Click Create New Approval Process.

4. Ensure that the Add the Submit for Approval and Approval History option is checked.

   You can specify conditions, if applicable, in the Entry-Specific Criteria section.
5. Choose Automatically assign approvers and set it to anyone with the SysAdmin role.

6. Create a custom picklist field in the transaction record by navigating to Setup, clicking Object Manager, and then clicking Transaction. Ensure that the field is not set as a multi-select picklist.

7. Give the picklist field three values to distinguish between Pending Approval, Approved, and Rejected.

8. Add the custom field to the Transaction Layout.

   If you skipped the previous step, you can add the field to the Transaction Layout like so:

9. Go back to the approval process, click Initial Submission Actions, click Add New, and then select Field Update. Configure it with the required values.
10. To ensure that the relevant fields are updated based on the outcome of the approval process, repeat step 9 for the Approval Actions and Rejection Actions sections. The following screenshot shows the final rejection option.

    If you included email alerts along with field updates, the approval process should resemble the following:

    If the final approval process has only field updates, it should resemble the following:

11. Click Activate.

12. To ensure that CORS includes the URL, in the Setup search bar, search for <kbd class="ph userinput">CORS</kbd>, or go to Setup, click Security, and then click CORS. Verify that these are included in the CORS:


{#transaction-manager-integrate-salesforce-approvals__ol_gbl_l3k_hhc}

## ServiceNow Quote Experience setup integrations {#transaction-manager-integrate-salesforce-approvals__Integrations}

Create two integrations for an event that will be used to submit the record for approval through ServiceNow Quote Experience.  
Note:  
If you want to test these calls in Postman, the endpoint is the my Salesforce URL: \<https://logik-1e-dev-ed.develop.my.salesforce.com/\>.

1. Receive the Salesforce record ID: Fetch the right Salesforce record ID using the UUID. This integration is used for filling in the custom field for the integration above.
   * Connection: Salesforce
   * GETAdditional path: `/services/data/v62.0/query/?q=SELECT Id, CreatedDate, LGK__TransactionUUID__c FROM LGK__Transaction__c WHERE LGK__TransactionUUID__c = '{{http://txn.id/}}'ORDER BY CreatedDate
     DESC`

   {#transaction-manager-integrate-salesforce-approvals__ul_ccl_l3k_hhc}

   Response Transformation:

       {
         "fields": [
           {
             "variableName": "txn.custom.sfRecordID",
             "value": {{#each records}}{{#if @first}}"{{this.Id}}"{{/if}}{{/each}}
           },
           {
             "variableName": "txn.custom.opportunityName",
             "value": {{#each records}}{{#if @first}}"{{this.LGK__OpportunityId__r.Name}}"{{/if}}{{/each}}
           },
           {
             "variableName": "txn.custom.accountName",
             "value": {{#each records}}{{#if @first}}"{{this.LGK__AccountId__r.Name}}"{{/if}}{{/each}}
           }
         ]
       }

   UPDATED QUERY USE
   THIS:

       /services/data/v62.0/query/?q=SELECT Id, CreatedDate,LGK__OpportunityId__c,LGK__OpportunityId__r.Name, LGK__AccountId__r.Name, LGK__AccountId__c,LGK__TransactionUUID__c FROM LGK__Transaction__c WHERE LGK__TransactionUUID__c ='{{txn.id}}'ORDER BY CreatedDate DESC

   contextActorId
   refers to the system Admin Record ID in Salesforce. It can be obtained by navigating to Setup and clicking Users, and then copying the ID from the URL of the user page.

2. Submit for approval.
   * Connection: Salesforce
   * POSTAdditional path: `/services/data/v62.0/process/approvals`

   {#transaction-manager-integrate-salesforce-approvals__ul_a5g_3yk_hhc}

{#transaction-manager-integrate-salesforce-approvals__ol_bcl_l3k_hhc}

Request Transformation:

    {
      "requests" : [{
      "actionType": "Submit",
      "contextId": "{{txn.custom.sfRecordID}}",
      "nextApproverIds": [],
      "comments":"The line item has a discount percentage of {{txn.custom.overallDealDiscount}}%",
      "contextActorId": "005bm000003SKtJ", -- SF Record ID of user highlighted above
      "processDefinitionNameOrId" : "TM_SF_Approval", --should be the unique name fro process definition detail highlighted above
      "skipEntryCriteria": "true"}]
    }

Make sure that the transform template has these values correctly:


## ServiceNow Quote Experience setup creating events {#transaction-manager-integrate-salesforce-approvals__Creating-Events}

Slack Approvals Integration is implemented through headless event API calls. In this approach, we'll use these headless API calls in a record-triggered flow and perform the callout through Apex actions.

Note that the two integrations created in the previous step are designed to work in sequence. The first integration receives the Salesforce record ID, and the second integration submits it for approval. Alternatively, the process
of receiving the Salesforce ID can occur on the Open Transaction action by adding the necessary configuration at that stage.

Create two additional events that will move the stage either forward for approval or backward for revision. Be sure to note their respective variable names for use in the API callout configuration.


## Add the Submit for approval option to ServiceNow Quote Experience {#transaction-manager-integrate-salesforce-approvals__Adding-the-Submit-for-Approval-button-to-the-layout}

The button events can be added to the default_draft layout using the following JSON format:

    {
      "type": "button",
      "event": "submitForApproval",
      "label": "Revise",
      "columnOrder": 2,
      "variableName": "revise"
    },

Make sure to add the custom field to the `draft fields: []` section; it's not necessary to include it in the layout.

    {
      "type": "ReadOnlyText",
      "label": "SF Record ID",
      "variableName": "txn.custom.sfRecordID"
    },

## Record-triggered flow {#transaction-manager-integrate-salesforce-approvals__Record-Triggered-Flow}

To set up the VS code environment, install the VS Code extensions from this document: [Sales Engineering Team Member Setup](https://logikio.atlassian.net/wiki/spaces/SE/pages/1340342294)

1. Following the [Trailheads approval process](https://trailhead.salesforce.com/content/learn/modules/business_process_automation), create a picklist record on the LGK__Transaction__C object that has the current approval state of the transaction, and ensure the process updates the record based on approval, rejection, and pending approval.

   The following image shows a custom field that triggers the record-triggered field: the Approval_Status__C field that you made when you created the
   approval process.

   The following image shows what the flow will look like when it's complete.

2. In the Start block, click Edit.

   Trigger on the LGK__Transaction__C object based on the custom field, ensuring that a UUID is not null. Also make sure to click Run Asynchronously and Only when a record is updated to meet.

3. Add a decision block, and create outcomes for when the custom field you created is approved or rejected.

{#transaction-manager-integrate-salesforce-approvals__ol_qcl_l3k_hhc}

## Apex Code {#transaction-manager-integrate-salesforce-approvals__Apex-Code}

Although this Apex Class was deployed through VS code, it could also be deployed in Salesforce. The first step is the create a new Project with manifest.

Next, create an Apex class (in the blue box) as well as a manifest.xml file (in the green box) to go into the respective files in the project directory.

Apex code:

    global with sharing class TransactionManagerFlow {
        global class FlowInput {
            @InvocableVariable(label='Triggering Record' required=true)
            global LGK__Transaction__c triggeringRecord;
        }
        // Handle logic for Rejected status
        @InvocableMethod(label='Logik.io Transaction callout from Salesforce' description='Makes callout to transition Logik.io transaction stage.')
        global static void handleApprovalStatus(FlowInput[] requestInputs) {
            System.debug('Handling Rejected status for Record: ' + requestInputs[0].triggeringRecord.Id);
            LGK__ConfigurationTenant__c customSettings = LGK__ConfigurationTenant__c.getInstance();
            String updatedRuntimeToken = '_gdyi0w0oGu1bNk3PO5exhUGqDFcZQVLIw';
            System.debug(updatedRuntimeToken);
            String endpoint = 'https://se-txn-sandbox.test02.logik.io';
            for (FlowInput eachTxn : requestInputs) {
                // Make the API request to transfer a transaction from 'new' stage to 'rejected' stage
                // (compare with snippet from ApprovalProcessHandler.makeApiCall)
                String uuid = eachTxn.triggeringRecord.LGK__TransactionUUID__c;
                Http http = new Http();
                HttpRequest request = new HttpRequest();
                request.setHeader('Origin', endpoint);
                if (eachTxn.triggeringRecord.Approval_Status__c == 'Rejected') {    
                    request.setEndpoint(endpoint + '/api/t/' + String.valueOf(uuid) + '/events/revise'); // Example endpoint
                    System.debug('Endpoint set for rejection' + request.getEndpoint());
                } else if (eachTxn.triggeringRecord.Approval_Status__c == 'Approved') {
                    request.setEndpoint(endpoint + '/api/t/' + String.valueOf(uuid) + '/events/proceedToApproved'); // Example endpoint
                    System.debug('Endpoint set for approval' + request.getEndpoint());
                }
                request.setMethod('POST');
                request.setHeader('Authorization', 'Bearer ' + updatedRuntimeToken);
                request.setHeader('Content-Type', 'application/json');
                request.setBody('{}');  // Convert to JSON if inputs are needed
                System.debug(request);
                if (!Test.isRunningTest()) {
                    HttpResponse response = http.send(request);
                    if (response.getStatusCode() != 200) {
                        System.debug(LoggingLevel.ERROR, 'Error transitioning transaction: ' + response.getStatusCode());
                        System.debug(LoggingLevel.ERROR, response.getBody());
                    } else {
                        System.debug('Rejected API Call Failed: ' + response.getStatusCode() + ' - ' + response.getBody());
                    }
                } else {
                    eachTxn.triggeringRecord.LGK__TransactionUUID__c = 'testUUID';
                }
            }
        }
    }

XML:

    <?xml version="1.0" encoding="UTF-8"?>
    <Package xmlns="http://soap.sforce.com/2006/04/metadata">
        <types>
            <members>TransactionManagerFlow</members>
            <name>ApexClass</name>
        </types>
        <version>61.0</version>
    </Package>

Next, if you're not logged into the org you want to deploy to, do so with the `sf org login web` command, which takes you to login.salesforce.com.

When you've authorized CLI, the result should resemble the following:

Note:  
If you're logged into multiple orgs through CLI, use this command to switch:

`sf config set target-org=<username>`

When you're logged in, execute this command:

`sf project deploy start --manifest manifest/package.xml`

Add the Apex actions after the decision blocks, and make sure your flow looks similar to the one provided in the screenshot. (Look for a name that matches the label parameter in the invocable method.)

Finally, activate the flow and test.

## Testing {#transaction-manager-integrate-salesforce-approvals__Testing}

After the record-triggered flow and the ServiceNow Quote Experience blueprint are created, you may find this SOQL query helpful for debugging your approvals process in Salesforce.

Receiving Salesforce Approval Status (getting the state of most recent process)

* Connection: Salesforce
* GET
  * Additional Path: {_endpoint}/services/data/v61.0/query/? q=SELECT+Id,Status,TargetObjectId+FROM+ProcessInstance+WHERE+TargetObjectId={{sfRecordId}}+ORDER+BY+CreatedDate+DESC
  * SOQL Query
  {#transaction-manager-integrate-salesforce-approvals__ul_vcf_qjk_hhc}

{#transaction-manager-integrate-salesforce-approvals__ul_avn_rjk_hhc}

    SELECT Id, Status, TargetObjectId 
    FROM ProcessInstance 
    WHERE TargetObjectId-'006bm000002IUI4AAO' -- This is the sf oppy/transaction object  id
    ORDER BY CreatedDate DESC


