Account External IDs

How to operationalize External IDs on Accounts

Add a new External ID to your Salesforce Account Object

  1. In Salesforce, go to Setup, open the Object Manager, and click on the Account Object.

  2. Select Fields & Relationships and press the New button in the top right.

  3. Select the type of field. You'll want to stick to the Text type as most others cannot be made into an External ID in the next step.

  4. Define your new ID field as Primer ID, confirming the API name is Primer_ID__c. Make sure to select in the field settings: External ID AND Unique. You can choose between case-sensitive and case-insensitive.

Unique is strongly recommended. Without it, two records may have the same identifier value and we can't ensure we're updating the correct record. Case insensitive is a safer choice if you're ever going to have humans inputting website values. However, in rare cases, this could introduce a problem with computer-generated identifiers.

  1. Continue through the field creation process and hit Save.

  2. The field should now appear as an option in Primer when creating a new sync. You may need to hit the Refresh button next to the menu if we haven't updated metadata since you created the new field.

Next, you're going to need to build a Flow to copy the Account website into this new external ID field. We'll describe how to do this in the next step, which includes website cleaning.

Populate the new External ID and Unique field

Now that a new External ID and Unique field are created (e.g., Primer External ID), the existing values of all Accounts' Website fields need to be filled retroactively and continuously going forward. We'll also make sure that the copied field is cleaned. This can also be done on the Website field before copying, whatever is preferred.

Back-fill Primer External ID

  1. In Salesforce, go to Setup and Quick Find Flows.

  2. Select Flows and click New Flow in the upper right. This will open the Flow Builder.

  3. Select Schedule-Triggered Flow. Click Create.

  4. Set the Schedule to a time in the future when this mass update should run. If you have a lot of Accounts, you should schedule this for an off-peak time, such as during a weekend or early-morning hours. Set Frequency to Once.

  5. Follow the Choose Object prompt and search for the Account object. If you would like to test update specific Accounts, you may specify the conditions here. Otherwise, select None—Run Flow For All Accounts under Condition Requirements and click Done.

  6. Click the (+) Add Element button on the Flow Builder UI. Scroll to the bottom and select Update Records.

  7. Label the Update Records Element as you'd like, such as Fill Primer External ID. The API Name should populate automatically. Ensure Use the account $Record global variable is selected under How to Find Records to Update and Set Their Values. Next, similar to Step 5, select None—Always Update Record. Finally, search for your newly created Primer External ID field in the Set Field Values for Account Record section. In the Value text box, click the drop-down element + New Resource. This will open another modal.

  8. In the Resource Type drop-down, select Formula. Name the Formula and select Text from the Data Type drop-down. Next, copy and paste the URL cleaning formula into the Formula text area. Once pasted, click Done and Done again. Save and Activate your new Flow and it will update the field at the time you specified in Step 4.

Continually update the Primer External ID field

  1. In Salesforce, go to Setup and Quick Find Flows.

  2. Select Flows and click New Flow in the upper right. This will open the Flow Builder.

  3. Select Record-Triggered Flow and click Create.

  4. At the prompt, select the Account object. Trigger the flow when A record is created or updated. Do not set any condition requirements. Select Fast Field Updates. Click Done.

  5. Click the (+) Add Element button on the Flow Builder UI. Click Assignment under Logic.

  6. Name the assignment. Select the $Record global variable and then Primer External ID field. Keep the Equals operator. In the Value text box, click the drop-down element + New Resource. This will open another modal.

  7. In the Resource Type drop-down, select Formula. Name the Formula and select Text from the Data Type drop-down. Next, copy and paste the URL cleaning formula into the Formula text area. Once pasted, click Done and Done again. Save and Activate your new Flow so any records created or updated going forward will have your new field filled.

Now that the External ID is setup and filled, we're all set to start pushing data into the Account object in your Salesforce instance.

Last updated