To create a Lookup field in Salesforce based on data passed from Award Force, there needs to be a known identifier. Here's how to do it:
If you have two objects in Salesforce where you need specific records in those objects to related to each other, you need to have a lookup field in one of those Salesforce objects (the latter one).
To achieve this lookup relationship using Award Force integrations, you must have two integration steps in Award Force where one has a dependency on the other. This approach allows an ID to be shared from one integration to the next. We capture this ID in a dedicated variable called {id} which is sent back from Salesforce once the first integration step has completed.
Scenario: to relate a contact record with an entry record in Salesforce
- Your Salesforce objects may be named differently from the examples in this article
- We're using custom object Salesforce API naming conventions for all Salesforce objects in this article.
- For this example, we're working exclusively with the action of an entry being submitted. In an Award Force integration, this is the Entry information section of an integration.
First, you need to have two objects in Salesforce, for example, Contact and Entry. Let's call these SF_contact__c and SF_entry__c.
Both of these objects will have their own unique fields, however, the SF_entry__c object must have a Lookup field pointing at the field value where the email address (i.e unique identifier) is stored in the SF_contact__c object. Let's call this Lookup field Entrant_email__c.
Then, in Award Force, you will need two integrations, one for creating/updating a record in the SF_contact__c object, the other for creating/updating a record in the SF_entry__c object. Let's call these Award Force integrations "AF Contact" and "AF Entry".
Step 1: create a contact record with email as the unique identifier
From Award Force, you have a dedicated and authenticated Salesforce integration that triggers when an entry has been successfully submitted. The unique identifier in the "AF Contact" integration is the entrant's email address. The email address is used to find the record in the SF_contact__c object and if it exists, the record is updated, if it does not exist, the record is created.
Once the SF_contact__c record has been successfully created, Salesforce sends back an ID in the variable {id} which is the unique identifier (i.e the email address).
Step 2: create an entry record with the entry slug being the unique identifier and pairing {id} with your lookup field
Once the first integration step has completed the next dependency integration will trigger. At this time the AF Entry integration is creating a new record in the SF_entry__c object using the Entry slug as the unique identifier. As part of this integration's field pairing, you need to add {id} into Entrant_email__c (i.e the Lookup field) in the SF_entry__c object which is done at the very bottom of the Entry information section in the integration, you will need to add a new CRM field pairing.
Example: AF Entry integration configuration
Once this is done, you should be able to run a test where you submit an entry in Award Force and as a result of this, you will have two records created in your Salesforce account, one in the SF_contact__c object and one in the SF_entry__c object where both records relate to each other.