Add Company Logos to Salesforce with LogoRouter
A practical guide to displaying company logos in Salesforce account records, list views, and Lightning components using LogoRouter — including formula fields, LWC, and Apex caching.
Salesforce is incredibly powerful but visually dense. Account list views, contact records, and opportunity pipelines are walls of text — and sales teams burn time parsing company names when they could be identifying accounts visually in an instant. Adding company logos transforms how your team navigates the CRM.
This guide covers three levels of integration: a simple formula field (10 minutes), a polished Lightning Web Component (1 hour), and an Apex-cached production setup (half day).
Level 1: Formula Field (10 minutes)
The fastest approach uses Salesforce's IMAGE() formula to pull logos directly in account views.
In Salesforce Setup, navigate to Object Manager → Account → Fields & Relationships → New:
- Field Type: Formula
- Field Name: Company_Logo_c
- Return Type: Text
Formula:
IMAGE(
"https://img.logorouter.com/" &
SUBSTITUTE(SUBSTITUTE(Website, "https://", ""), "http://", "") &
"?size=64",
Name & " logo",
40, 40
)Add this field to your Account List View layout for an instant visual upgrade. No code, no deployment.
Level 2: Lightning Web Component
For a more polished integration with loading states and error handling:
// force-app/main/default/lwc/companyLogo/companyLogo.js
import { LightningElement, api, track } from 'lwc';
export default class CompanyLogo extends LightningElement {
@api domain;
@api size = 48;
@api name = '';
@track status = 'loading';
get logoUrl() {
if (!this.domain) return null;
const cleanDomain = this.domain
.replace('https://', '')
.replace('http://', '')
.replace('www.', '')
.split('/')[0];
return `https://img.logorouter.com/${cleanDomain}?size=${this.size * 2}&format=webp`;
}
get initials() {
return (this.name || this.domain || 'CO').slice(0, 2).toUpperCase();
}
get showLogo() { return this.status !== 'error'; }
get showSkeleton() { return this.status === 'loading'; }
get showInitials() { return this.status === 'error'; }
handleLoad() { this.status = 'loaded'; }
handleError() { this.status = 'error'; }
}<!-- force-app/main/default/lwc/companyLogo/companyLogo.html -->
<template>
<div class="logo-container" style={containerStyle}>
<template if:true={showSkeleton}>
<div class="skeleton"></div>
</template>
<template if:true={showLogo}>
<img
src={logoUrl}
alt={name}
width={size}
height={size}
class="logo-img"
onload={handleLoad}
onerror={handleError}
/>
</template>
<template if:true={showInitials}>
<span class="initials">{initials}</span>
</template>
</div>
</template>Level 3: Apex Caching (Production)
For high-volume orgs, cache logos server-side in Salesforce to reduce external callouts:
// LogoRouterService.cls
public with sharing class LogoRouterService {
private static final String API_KEY = Label.LogoRouter_API_Key;
private static final Integer CACHE_TTL_SECONDS = 86400;
public static String getLogoUrl(String domain) {
// Check platform cache first
Cache.OrgPartition cache = Cache.Org.getPartition('local.logoCache');
String cacheKey = 'logo_' + domain.replaceAll('[^a-zA-Z0-9]', '_');
String cachedUrl = (String) cache.get(cacheKey);
if (cachedUrl != null) return cachedUrl;
// Fetch from LogoRouter
String logoUrl = 'https://img.logorouter.com/' + domain + '?size=128&format=webp&token=' + API_KEY;
// Validate the URL resolves
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(logoUrl);
req.setMethod('HEAD');
req.setTimeout(5000);
try {
HttpResponse res = http.send(req);
if (res.getStatusCode() == 200) {
cache.put(cacheKey, logoUrl, CACHE_TTL_SECONDS);
return logoUrl;
}
} catch (Exception e) {
System.debug('LogoRouter: failed to resolve ' + domain + ': ' + e.getMessage());
}
return null;
}
}Impact on Sales Team Productivity
Sales teams that implement logo enrichment in their CRM consistently report:
- Faster account identification in list views and global search
- Improved data quality — wrong accounts are spotted visually
- Better stakeholder presentations with logos in reports
- Higher Salesforce adoption rates (it simply looks better)
The ROI on a half-day implementation is immediate and measurable.
Enterprise plans include CRM integration support
Our Solutions Engineering team helps enterprise customers integrate LogoRouter with Salesforce, HubSpot, Pipedrive, and more. Start on the free tier to explore.
Enterprise — custom pricingCompany logos and brand data, ready in 60 seconds
500,000 requests per month, completely free. No credit card. No contracts. Upgrade to a paid plan when you are ready to scale.
- 500K requests / month free
- 30M+ company logos
- Sub-50ms global CDN
- PNG, WebP & SVG formats
- No credit card required
Topics covered