How to extract information from social media channels and create a lead in ServiceNow SOMT

ankur203097
Tera Contributor

Hi,

I am building a sales process in ServiceNow SOMT. One of the requirements is to create a lead by integrating with external channels like social media, whatsapp etc. gathering the information and auto creating a lead. Is this possible out of the box ? If not do we need to create a custom spoke for the different social media channels get the information, extract the information relevant to creating a lead and then insert it into the lead table ?

1 REPLY 1

MaxMixali
Mega Sage
Out-of-the-Box CapabilitiesWhat SOMT Lead Management Provides Natively:
 
1. Standard Lead Creation Methods:
 
Manual lead entry via UI
Web forms (Service Portal/Experience)
Email-to-Lead conversion
Import sets (CSV/Excel bulk import)
REST API for programmatic lead creation
 
2. Integration Hub Spokes:
ServiceNow provides some pre-built spokes, but none specifically for social media or W H A T S A P P 
lead capture out of the box with SOMT.What's NOT Available Out of the Box:
 
Direct social media integration (Facebook, Instagram, LinkedIn, Twitter/X)
W H A T S A P P Business API integration
Automated message parsing and lead extraction
Social media listening/monitoring tools
Multi-channel conversation management
Bottom line: You'll need to build custom integrations for social media and W H A T S A P P lead capture.
 
 
 
Recommended Implementation Approaches  
 
1: Custom Integration Hub Spokes (Recommended)Build custom spokes for each channel to 
automate lead creation:A. W H A T S A P P Business API IntegrationPrerequisites:
 
W H A T S A P P Business API account (via Meta or BSP provider)
Webhook endpoint capability in ServiceNow
Implementation Steps:
Create Custom Spoke for W H A T S A P P:
 
javascriptSpoke Components:
- Connection & Credential Alias (for W H A T S A P P API)
- Actions:
  * Receive W H A T S A P P Message (webhook)
  * Send W H A T S A P P Response
  * Get Contact Information
  * Mark Message as Read
Create Scripted REST API for Webhook:
 
// Receive incoming W H A T S A P P messages
(function process(request, response) {
    var body = request.body.data;
    var message = body.messages[0];
    
    // Extract message details
    var phoneNumber = message.from;
    var messageText = message.text.body;
    var contactName = message.profile.name;
    
    // Parse message for lead information
    var leadData = parseMessageForLeadInfo(messageText);
    
    // Create lead if valid
    if (leadData.isValid) {
        createLeadFromW H A T S A P P(phoneNumber, contactName, leadData);
    }
    
    // Send acknowledgment
    response.setStatus(200);
    response.setBody({status: 'success'});
    
})(request, response);
 
 
 
**** W H A T S A P P ****
Flow Designer - W H A T S A P P Lead Creation:
 
Trigger: Scripted REST API receives W H A T S A P P message
 
Actions:
1. Parse Message Content (extract name, interest, contact details)
2. Check for Duplicate Lead (by phone number)
3. Enrich Data (lookup location, validate phone)
4. Create Lead Record with:
  - Source: W H A T S A P P
  - Contact details from message
  - Initial conversation notes
  - Lead score based on message content
5. Assign to Sales Agent (based on territory/product)
6. Send W H A T S A P P Response (confirmation message)
7. Notify Assigned AgentB. Social Media IntegrationFor Facebook/Instagram (Meta Platforms):Prerequisites:
 
 
**** Facebook ****
Facebook Business Account
 
Meta Graph API access
Facebook Page with messaging enabled
Implementation:
Custom Spoke for Meta/Facebook:
 
javascript Connection Configuration:
- OAuth 2.0 authentication
- Meta Graph API endpoints
- Webhook subscriptions
 
Actions:
- Get Page Messages
- Get User Profile Information
- Send Message Response
- Get Post Comments/Interactions
Webhook Handler for Facebook Messages:
 
(function process(request, response) {
    var body = request.body.data;
    
    // Facebook sends message events
    if (body.entry && body.entry[0].messaging) {
        var messaging = body.entry[0].messaging[0];
        
        if (messaging.message) {
            var senderId = messaging.sender.id;
            var messageText = messaging.message.text;
            
            // Get user profile from Facebook API
            var userProfile = getFacebookUserProfile(senderId);
            
            // Create lead
            createLeadFromFacebook(userProfile, messageText);
            
            // Send automated response
            sendFacebookResponse(senderId, "Thank you! A sales representative will contact you soon.");
        }
    }
    
    response.setStatus(200);
    
})(request, response);For LinkedIn:Prerequisites:
 
**** LinkedIn ****
 
LinkedIn Company Page
LinkedIn Marketing Developer Platform access
Lead Gen Forms (LinkedIn native feature)
Implementation:
javascriptIntegration Approach:
1. Set up LinkedIn Lead Gen Forms
2. Configure webhook to ServiceNow
3. Create custom spoke for LinkedIn API
4. Flow to parse form submissions and create leadsFor Twitter/X:Prerequisites:
 
 
 
**** TWITTER / X ****
 
X Premium/Business API access
Webhook capability
Implementation:
javascriptUse Cases:
- Monitor brand mentions
- Capture DM inquiries
- Track specific hashtags
- Extract lead intent from tweets
 
 
 Architectural Scheme:  
 
┌─────────────────────────────────────────────────────┐
│          External Channels                          │
│  W H A T S A P P | Facebook | Instagram | LinkedIn | SMS   │
└────────────────────┬────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────────┐
│     Integration Layer (Optional Middleware)         │
│           Twilio / Custom API Gateway               │
└────────────────────┬────────────────────────────────┘
                     │
                     ▼
┌───────────────────────────────────────────────────┐
│          ServiceNow Integration Hub               │
│                                                   │
│  ┌─────────────────────────────────────────┐      │
│  │  Custom Spokes (per channel)            │      │
│  │  - W H A T S A P P Spoke                       │      │
│  │  - Facebook Spoke                       │      │
│  │  - LinkedIn Spoke                       │      │
│  └─────────────────────────────────────────┘      │
│                     │                             │
│                     ▼                             │
│  ┌─────────────────────────────────────────┐      │
│  │  Flow Designer - Lead Creation Flow     │      │
│  │  1. Receive message                     │      │
│  │  2. Parse content (NLP/AI optional)     │      │
│  │  3. Extract lead data                   │      │
│  │  4. Validate & enrich                   │      │
│  │  5. Check duplicates                    │      │
│  │  6. Create/update lead                  │      │
│  │  7. Route to agent                      │      │
│  │  8. Send response                       │      │
│  └─────────────────────────────────────────┘      │
└────────────────────┬──────────────────────────────┘
                     │
                     ▼
┌────────────────────────────────────────────────────┐
│            SOMT Lead Management                    │
│                                                    │
│  - Lead Record with channel source                 │
│  - Conversation history attached                   │
│  - Auto-assignment rules applied                   │
│  - Lead scoring based on channel/content           │
└────────────────────────────────────────────────────┘