Introduction
For security reasons, the token used for Salesforce will expire periodically. Instead of generating a new token for every request—which is inefficient—it is best to implement a temporary storage solution. This allows the refreshed token to be stored temporarily in a table, along with essential credentials needed to generate a new token. These include:
User Credentials |
Refresh Token |
|---|---|
Username |
Client ID |
Password |
Client Secret |
Client ID |
Refresh Token |
Client Secret |
Due to character size limitations in table columns, the token will be split into two parts, stored as accessTokenPartOne and accessTokenPartTwo.
Warning – If your Salesforce password expires in accordance with your organization's Salesforce password policy, you must update both your Salesforce login password and security token in the password column within SharpenDB to restore API functionality (e.g., Salesforce record lookups).
password = yourSalesforceLoginPassword + yourSalesforceSecurityToken
Creating a Table in SharpenDB
Step 1: Navigate to SharpenDB
Go to Admin → Configuration → SharpenDB.
If this option is not available, contact the Sharpen Care team to enable this feature.
Step 2: Create a New Table
On the SharpenDB page, click New Table in the upper left corner.
Name the table appropriately and note the name for future reference when building your Logic+ flow.
Click Create to proceed.
Step 3: Define Table Structure
Two tabs will appear: Data and Structure.
Click on the Structure tab.
Select Add Column in the top-right corner.
-
Define each column with the following properties:
Column Name: Enter the name of the column (see list below).
Type: Select varchar.
Default Value: Set to NULL.
-
Repeat this process for each of the following columns.
If you selected OAuth User Credentials, use that column when creating your SharpenDB table.
If you selected OAuth Refresh Token, use that column instead to define your column names in SharpenDB."
User Credentials |
Refresh Token |
|---|---|
name |
name |
accessTokenPartOne |
accessTokenPartOne |
accessTokenPartTwo |
accessTokenPartTwo |
username |
clientId |
password |
clientSecret |
clientId |
refreshToken |
clientSecret |
Click Save after adding each column.
You may use different column names if preferred, but the templates are designed using the naming scheme above.
Step 4: Populate the Table
In the Name column, enter a clear identifier (e.g., Sandbox or Production). This value will be used for lookups in your flow.
Option A: OAuth User Credentials
Enter your Salesforce username.
-
In the password column, append your Salesforce Security Token to the end of your login password.
Format:
password = yourSalesforceLoginPassword + yourSalesforceSecurityTokenExample:
Salesforce Password:
MyPassword123!Salesforce Security Token:
XYZ456789Resulting Password Entry:
MyPassword123!XYZ456789
Input the previously generated clientId and clientSecret.
Leave accessTokenPartOne and accessTokenPartTwo as
NULL. These values will be automatically populated once your Logic+ flow is completed and tested.
Option B: OAuth Refresh Token
Input the previously generated clientId, clientSecret, and your Refresh Token.
In the refreshToken column, enter your Refresh Token that have you previously collected in OAuth “Refresh Token“ Guide for API Access.
Leave accessTokenPartOne and accessTokenPartTwo as
NULL. These values will also be automatically populated once your Logic+ flow is completed and tested.