Introduction
Integrating Salesforce with external systems via API operations is crucial for maintaining accurate and up-to-date data. This guide provides a detailed walkthrough on how to update existing Salesforce records using an API call. It covers the key operation for updating a Case while outlining the necessary request methods, headers, and body structures. Additionally, this article explains how to use variables within Logic+ flows to dynamically retrieve and update data, ensuring seamless integration with external systems.
When constructing the URL path, request headers, or request body, you may notice variables marked with $() syntax (for example, $(caseId)). These variables must be defined earlier in your Logic+ flow before they can be used. A common way to set these variables is by performing a lookup operation to retrieve an object ID, which can then be passed into these integration panels.
Update Case
The Case update API operation allows you to modify existing case records in Salesforce, enabling you to track progress and maintain accurate support ticket information.
API Overview: This API operation supports updating various case fields including Status, Priority, Description, and custom fields. It requires the Case ID and validates field-level security and sharing rules before making updates. The operation can trigger workflow rules and process builders configured in your Salesforce organization.
Integration Panel Settings Example
Integration*:
Select your integration's base URL from the dropdown menu. This URL should have been configured during your initial setup [internal Confluence reference, not a working link] on the Integrations page.
Path:
/services/data/v59.0/sobjects/Case/$(caseId)Request Method:
PATCHRequest Headers:
{
"Content-Type": "application/json; charset=UTF-8",
"Authorization": "OAuth $(accessToken1)$(accessToken2)"
}Request Body:
{
"Comments": "Interaction Notes: $(notes)"
}Content Type:
JSONVariables:
Define a variable to store your token, using the JSONPath syntax as demonstrated below.
$.data.0.messagestatusTextUpdate Case Logic+ JSON Template
{
"panels":[
{
"type": "integration",
"initiator": true,
"name": "caseUpdate",
"coordinates": {
"x": 144.7958809880775,
"y": -163.66023268167925
},
"fields": {
"integrationId": "004hq3tmn7b4pyfv84",
"path": "/services/data/v59.0/sobjects/Case/$(caseId)",
"method": "PATCH",
"headers": {
"Content-Type": "application/json; charset=UTF-8",
"Authorization": "OAuth $(accessToken1)$(accessToken2)"
},
"contentType": "JSON",
"timeout": 30,
"variables": [
{
"name": "errorMessage",
"jsonpath": "$.data.0.message"
},
{
"name": "status",
"jsonpath": "statusText"
}
],
"fireAndForget": false,
"requestBody": {
"Comments": "Interaction Notes: $(notes)"
}
},
"exits": {
"default": "",
"timeout": "",
"error": ""
},
"version": "2.2.0"
}
]
}