Apps and databases connector Salesforce Estimated reading: 13 minutes 317 views Cellosign integration with your Salesforce instance provides two-way communication channel where Cellosign can perform Create, Read, Update and Delete operations on your Salesforce objects. In addition with Cellosign app for Salesforce installed on your instance, you will also be able to customize Salesforce Webflows to initiate business process in Cellosign.ResilienceWe understand that the typical organization has more than one data source to interact with in a business process, for example business process can be initiated from Salesforce, additional data should be fetched from another source by API and so on. Having said that, our approach to application connector is to grant you with the possibility to integrate with any number of data sources and APIs.Before we startSalesforce integration is part of Cellosign PRO bundle and requires activation. Please contact your CS contact for activation. In the activation process, you will be receiving in mail a unique URL to install Cellosign application for Salesforce.About this guideSalesforce and Cellosign requires two configurations:Configure your Salesforce instance in Cellosign. This is a mandatory step Install and configure Cellosign Salesforce package in your Salesforce instance. This is an optional stepConfigure your Salesforce instance in CellosignAt the end of this configuration you will be able to create templates in Cellosign that are connected with your Salesforce instance to Get data from objects, update Salesforce objects and upload files to Content version.To do that we need to create Connected app and then couple it on Cellosign application STEP 1: Create a Auth2 connected appLogin to your Salesforce instance Click setup on at the top right corner drop down and search for “App manager” Click on “New connected app” Insert name, and email Check Enable OAuth settings Insert Callback url. In case integration is made on Cellosign production enter “https://app.cellosign.com/callback/salesforce-callback”, else if it’s integrated with pre-production insert “https://preprod.cellosign.com/callback/salesforce-callback” aelect Selected OAuth Scopes: Manage user data via APIs (api), Manage user data via Web browsers (web), Full access (full), Perform requests at any time (refresh_token, offline_access), Access unique user identifiers (openid) Check “Require Secret for Web Server Flow” and “Require Secret for Refresh Token Flow“ Click Save Generate “Initial Access Token“ Click on “Manage consumer details”, Verify your account and keep “Consumer Key” and “Consumer Secret”STEP 2: Couple Connected app with CellosignIn Cellosign application dashboard, click Integrations on the left toolbar, click “Add” on Salesforce pane and next to start the processAlias and addressEnter an application alias. This alias will be used for implementing business processes, if there’s more than one integration give that meaningful name to avoid confusion.Enter your Salesforce addressConsumer key and secretCopy your Consumer key and secret from your connected app and insert on the following paneVerify callback and loginFollow on screen instructions for validating Cellosign callback URL on your connected app and click loginIn case you don’t see “Approve Salesforce login” pane, follow on screen instructions, most common reasons are:You will need to allow popups on your browser Consumer or Secret keys are incorrectVerifying installation After a successful setup you will be able to see a valid connection on Cellosign integration pane for SalesforceTroubleshootIn case of errors in completing this stageMake sure settings for Connected app are correct. Check token policy. In Salesforce search for “Manage connected apps”, locate your app. make sure “Refresh Token Policy” is set to “Refresh token is valid until revoked”Install and configure Cellosign Salesforce package in your Salesforce instanceAt the end of this configuration you will be able to create flows in Salesforce and connect it with Cellosign templates to:Create new interactive transactions Create Signed document (SEAL) Revoke transactionTo install this package, first we need to create a “Service user” in Cellosign. Add user and retain Access token.Install Package by adding the url below to your salesforce url.https://yourinstance.salesforce.com/packaging/installPackage.apexp?p0=04t8d000000hYmqSelect required profile and check “Acknowledge” for installing 3rd party package and click “Install”4. Approve installation process. Check “grant access” and click “Continue”5. Wait for the installation to complete [might take couple of minutes] and click done6. Next. we need to configure the application. On setup left pane search’ lookup “custom settings” and click on “custom settings” page7. Click on “Cellosign instance” and then click on “manage” on top pane and new on the next screen8. Next we need to configure credentials point to Cellosign instance on the following screenLabelRequiredValueAPI TokenYesInsert here your user Token [Or service user token]. This token will be used to authenticate the request in CellosignAuthorization TypeYesInsert here “Bearer Token”Instance URLYesInsert your Cellosign base instance url. For example, for shared pre-production insert “https://preprod.cellosign.com” [Note: without “/” at the end of the url]TimeoutYesEnter “30,000” for 30 seconds timeout9. Click “Save” when done.Next. Salesforce connection tabSynchronization paneClick on Gear icon and click on “Synchronization” pane.Use this function if you require to initiate new requests from Salesforce to Cellosign, first we need to enable synchronization. Otherwise, click the next tab.By checking Synchronization, template data [“Blueprints”] will be pushed from Cellosign to your Salesforce instance. This will enable to configure Salesforce actions [“flows”] and connect them with Cellosign templates.Use “Filter tags” option to sync only Cellosign templates that includes specific tags. If left blank, all templates within your project will be synced.Note: Sync occurs when saving a template.Connection test paneThis pane serves two debug functions:Make sure objects are pulled and refreshed. Refresh occurs automatically every 24 hours, however if you have applied changes in your Salesforce schema (such as adding tables and columns) click on “Pull instance schema” for fetching Salesforce objects so they can become visible to business process consumers, such as template connector. Dump requests that were made from Salesforce to Cellosign. To find the request ID click Transactions board, lookup your transaction, expand the result. The request ID is displayed at “Request Parameters” pane. Copy and paste the “Request ID” into “Connection test” pane and click “Execute request”. As a result a JSON file will be dumped to your browser with the full body requestBuild Salesforce connected business processWhat we want to do here is build a template that can be initiated from Salesforce to Cellosign that inject Salesforce AccountID. Cellosign connector will: Get the request Fetch Account name and website address from Salesforce Post the invitation to the client Get updated data back [On client submit] and update Salesforce with: Updated data and signed documentBuild templateCreate new template, name it “Update account” Drag and drop 3 Text fields and name it “Account ID”, “Account name” and “Website” Also add signature field Click on Template integrations and “Connector” and click “Add Preset Connector”. Follow this guide to set it up. Eventually your PRESET connector should look as in the image below. Make sure to save the template and go to your Salesforce instance to connect it [next step].Next we will build connector to update Account name and website on submit. Add new connector on “Submit”Next we will build connector to upload signed PDF and associate with it with account on submit. Add new connector on “Submit”.Save the connectors and the template.Connect Template to SalesforceIn your Salesforce instance search for “blueprints” in top left search paneClick on template that was created “Update Account”Note: In case you don’t have “Description” or “Create Date” columns, simply click gear icon on the top row. Click “select fields to display” and add those to view.Click the Blue print name link. This view display the blueprint ID, Name and related fields. Note that on “Related fields” there are two fields created by default.“Invitation recipient email or phone number”. Will be used to post the request to clients email or phone Fill form field <AccountNumber> from table <Account> column. Will be used for mapping field into action Creating flow (trigger) in SalesforceAt the end of this stage we will have a flow in Salesforce that is getting Account ID and posting request to Cellosign including: Blue print, Account is and client email. Flow should look as in the image belowClick on Gear icon at the top right corner and then “Setup” On quick find (top left) search “flows” and enter “flows” view Click “New flow” at top right corner select “Screen flow” and click “Create”First we need to define flow variable that we can consume within the flow.On the left pane of flow view, click the left most icon “Toggle toolbox” Click “New resource” button” On the opened pane select “Variable” Insert “recordId” on “API Name” Select “Text” for “Date type” Check “Available for Input” at the bottom and click saveNext, we need to define single parameter and collection of parameters flow variables that can consume blueprints data. Use “cellosign__ProcessParameter apex-defined” type for both.First we will create collections of parametersOn flow toolbox:Add new resource Select “Variable” Insert “varProcessParameters” on “API name” Select “Apex defined” on Data type Check “Allow multiple values” Select “cellosign__ProcessParameters” on “Apex class” Click “Done”Carry out the same process for single parameter.Add new resource Select “Variable” Insert “varProcessParameter” on “API name” [Note: var name is singular] Select “Apex defined” on Data type Select “cellosign__ProcessParameters” on “Apex class” Click “Done”Next. on flow diagram Click on “Add element” and Add “Get records”.Insert “Get SF Account data” to label Select “Account” on “Object” field On field, select “Id” to match Account ID On “Operator” pick “equals” On “Value” pick the variable “recordId” we just created Click “Done”At this stage we need to connect the collection of parameters to Cellosign blueprints.On flow diagram Add “Assignment” On “Label” insert “Build Parameters” Now we need to add key/value pairs for the invitation and Account IDFirst, we assign Key/Value pair to single parameter flow variable, and then add that variable to our parameters collection variable.You can assign fixed values to parameter, or you can assign values from specific record field (see 3rd parameter assignment – we assign account name).To add key/value pairs:On “Variable” add “varProcessParameter.Key” from the dropdown Set Operator as “Equal Set Field blueprint ID for invitation. [This should be copied from blueprints parameters page] On “Variable” add “varProcessParameter.Value” from the dropdown Set Operator as “Equal” Set Field from Account > phone number On “Variable” add “varProcessParameters” from the dropdown Set Operator as “Equal” Set Field “varProcessParameter” [Note: there’s no “s” at the end, for single]Carry out the same procedure to add “Account ID”. Eventually, “Build parameters” pane should look like this:Save the pane.Next, add element “Action”.Blueprint ID – ID of blueprint you want to initiate a process for Cellosign API Service developer name. Type one of these: start_process, seal_process – start_process Parameters – your collection variable of process parameters – Run Immediate – (True/False) – will define to run action synchronously (True) or asynchronously (False). Click “Save”At this stage you may add any conditions, logs, on screen display before flow ends.Save the flow and enter Connect to action buttonNow we want to add a button to trigger a form submission to client. to do so follow these steps:On Salesforce app, search and select “Accounts” page Click gear icon on top right and select “Edit Object” On left pane, select “Buttons, links and actions” Click “New action” On “Action type” select “flow Select the flow we crated previously Update label “My update” and saveNext we need to display this button on account page, for whenever is clicked, form will be submitted.On “Account Object manager”, click “Page layouts” and then “Account layout” Locate the Action created “My update” on top pane and drag it to “Salesforce Mobile and Lightning Experience Actions” And click saveOn account page you will find new button “My update”. Make sure you have mobile phone number on Account details and click “My update” to submit a formNow you should be receiving SMS with a link to form. If all configured correctly, you should see Account name and Website on the form.When form is submitted the data will be updated and PDF result is uploaded to Account related items.MethodsStartThis API initiates a new session process. This method is described above in detailsSEALSimilar to Start API (above) this API generate a new session. The differences are: Use key word “seal_process” for activation Response: since SEAL does not include interactive form, it does not include URLs as interactive session does. Instead, it includes the following response: { "id": "djE6czp0ZXN0ZW5nOm1lcHlMR3R4cmI=", "blueprint_id": "djE6dDp0ZXN0ZW5nOjQ3NzAwZTUxMjkzODQ2ZWJiZjQ4NmU3ZGU4ZmEzYTUy", "document": { "id": "mepyLGtxrb", "hash": "942adb09cda9d9602e4784513b14cff2" } }idEncoded unique id. Can be use later for delete APIblueprint_idTemplate blueprint used for the processDocument idClear text for unique idDocument hashPF Document hash. Hash can be used to verify the content when callback occursDeleteThis API revoke a session. Follow these steps to configure a delete session: In flow menu, add an APEX action, Search for “Delete Cellosign Process” action type Add “delete_process” to first input value Add process id to revoke. Process id is received on response to “start_process” Add logic as needed and save On success, process will return HTTP 201 status code, Otherwise will return 4xx or 5xx response Limitations and known issuesCurrently Cellosign package for Salesforce include session level API. That is workflow, BPM process types cannot be created via this package Field level blueprints includes only fields that are mapped for inquiry through the connector Create new session currently doe’s not include specific address for OTP. However the address included with the blueprint can be used for both the invitation and the OTP. This feature will be included in future versionsData types specificationsas asdasd asSalesforce datatypeHandling in CellosignPick listPicklist values are fetched using toLabel() api and not the API value Date and date timeDate and datetime objects in Salesforce are stored in ISO format. Using the connector you have the option to format the value to your requirementTimeNumbersCurrencyBooleanText and long textsProcess LogsCellosign installed package includes full log for APEX action that includes: Request URL, Body, response and time stamp for initiate and response. To view logs, type “Create Process Logs” is Salesforce quick search.Additional dataFollowing are object classes with Cellosign application that can be consumed for implementation.Class ProcessRequestLabelNametyperequireBlueprint IdblueprintIdStringTrueParametersparamsList of ProcessParameterTrueRun ImmediaterunImmediateBooleanTrueCellosign Api service developer nameCelloSignMdtNameStringtrueClass ProcessParameterLabelNametyperequireKeyKeyStringTrueValueValueStringTrueClass ProcessResponseLabelNametypeResultsresItemsList of ProcessResponseItemClass ProcessResponseItem:LabelDescriptiontypeisSuccessProcess initiation statusBooleanerrorMessageerror message if failedStringprocessIdUnique process ID in cellosignStringformIdThis is reference to Token generated in CellosignStringclientUrlUrl that was submitted to clientString Next - Apps and databases connector Microsoft SQL [MSSQL]