SlideShare a Scribd company logo
Publishing Data to REST APIs with
Lightning Process Builder
Scott Coleman
Principal Solutions Architect, Cloud Giants
scott@cloudgiants.com
@scottsalesforce
alex@cloudgiants.com
@KenneyAlexandra
Alex Kenney
Solutions Consultant, Cloud Giants
Welcome to Dreamforce
Why implement simple data integrations using Process Builder and Invocable Apex?
• Maximum use of platform features, filling gaps with code when necessary
• Using clicks instead of code increases maintainability and reusability
Key takeaways
• REST web service basics
• A mostly clicks approach to simple integration
• A process and some code that you can use right away!
• How to decide if this approach is for you - this isn't the only way (and isn't always the best way)
• Ideas about extending the solution to meet your specific needs
Thanks for joining us!
REST Web Services and APIs
What is an API?
• Application Programming Interface
• Defines the interface between one component and second component that provides services for it
What is REST?
• Representational State Transfer
• An architectural style that can be applied to APIs (most commonly on the web); a set of conventions or
rules
• Emphasis on lightweight payloads and predictable behaviors
REST API examples
• Slack webhooks
• Google Maps Geocoding API
• Salesforce REST API
A (Very) High Level Introduction
Calling Apex from Process Builder
Process Builder - have you used it?
You can call Apex methods from your process!
• Powerful way to create mostly-declarative solutions
• A chance for collaboration between admins and devs
• Use the "Apex" action type in Process Builder, select the method to call, and specify the values to pass into the
method
There are rules for your Apex class and method. It must:
• Method should be annotated with @InvocableMethod
• Only accept one List as its input parameter (though it can be custom type - use @InvocableVariable on members of
user-defined types)
• Be static and public/global
The Basics
Slack Integration
Demo
Slack is a popular
communication tool used by
companies, project teams,
other organizations
Possible use case: Notify
your team when a hot lead
lands in Salesforce
Let's run through a quick
demo of this simple
Salesforce to Slack
integration
Slack Integration
Slack configuration
• Define a webhook and specify which channel messages should appear in
• Take note of the webhook address
Responsibilities of our Process Builder process
• Know when to send a notification (criteria)
• Specify what data should be included in the notification
• Specify the address of the Slack webhook to which the notification should be sent
Configuration
Slack Integration
Process Builder
Let's walk through our
process!
Slack Integration
Not coupled to any particular object or webhook address
• Labels, values, and address passed in by process
• Same class can be used with any object that supports Process Builder
• Make sure to create a Remote Site in Salesforce for https://hooks.slack.com
Very simple implementation with basic capabilities
• Data structure is flat - not hierarchical
• Number of fields you can include in notification is limited
• Optional record link can be included so user can get more details
• Works great for most quick notifications
Apex Class
Slack Integration
Apex Class
Let's dive into the code!
Extending the Solution
Is this pattern right for you?
• Great for productivity features - not the best solution for reliable messaging, guaranteed delivery, business
critical scenarios
Payload format
• Slack's webhook uses a JSON (JavaScript Object Notation) payload, but your REST endpoint may use a
different format
• We're using a very flat data structure - maybe your target requires a hierarchical structure
Authentication
• Slack's webhook REST endpoint doesn't implement any authentication, but your target endpoint likely does
• Consider using Named Credentials (Spring '15 feature) to make your code simpler (more on this later)
Let us know how you extend the solution (or let us know if we can help!)
• Session Chatter feed, Twitter, Email
Meet your specific needs
Salesforce-to-Salesforce Integration
Demo
Possible use case: Publish new
accounts from one org to
another
Let's run through a quick demo
of this basic Salesforce to
Salesforce integration
Named Credentials
What are they?
• A configuration item that allows you to define the credentials that should be used when making a callout to
a particular external service, either per user or for all users
Why are they useful?
• Simplifies your Apex code by managing non-trivial authentication flows for you, like OAuth 2.0
• Keeps the endpoint address in one place, outside of your process and Apex code
What else is needed to make this work in our use case?
• A Connected App defined in the target org to grant access
• An Auth Provider defined in the source org to be used by the Named Credential for authentication in the
target org
An Introduction
Salesforce-to-Salesforce Integration
Responsibilities of our Process Builder process
• Similar to our first use case
• Know when to send a notification (criteria)
• Specify what data should be included in the notification
• Specify the Salesforce API endpoint to which the notification should be sent (and the credentials to be used)
• Used Named Credentials for this
Configuration
Salesforce-to-Salesforce Integration
Process Builder
Let's walk through our
process!
Salesforce-to-Salesforce Integration
Not coupled to any particular object or org
• Labels, values, named credential passed in by process
• Same class can be used with any object that supports Process Builder
Not appropriate in scenarios where data is business critical and we need guaranteed delivery
• This approach is best for informational integrations and data that isn't business critical (productivity)
Apex Class
Salesforce-to-Salesforce Integration
Apex Class
Let's dive into the code
and related authentication
config!
Resources
Get the Process, Code, and Step-by-Step Instructions
• Available at GitHub: https://github.com/scott-cloudgiants/df16-procbuilder-restapi
Salesforce Documentation
• Lightning Process Builder
• https://help.salesforce.com/HTViewHelpDoc?id=process_overview.htm
• InvocableMethod Annotation
• https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm
• Apex Web Services and Callouts
• https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts
• Named Credentials as Callout Endpoints
• https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_named_credentials.htm
Blog Posts
• Slack and Salesforce Integration by Christophe Coenraets - the inspiration for our approach!
• http://coenraets.org/blog/2016/01/slack-salesforce-integration/
• Salesforce to Salesforce integration using Named Credentials in 5 lines by Jitendra Zaa - more inspiration!
• http://www.jitendrazaa.com/blog/salesforce/salesforce-to-salesforce-integration-using-named-credentials-in-just-5-lines-of-code/
Q&A
Ask questions!
Thank Y u
Scott Coleman
Principal Solutions Architect, Cloud Giants
scott@cloudgiants.com
@scottsalesforce
Alex Kenney
Solutions Consultant, Cloud Giants
alex@cloudgiants.com
@KenneyAlexandra

More Related Content

PDF
The Need for Speed: Building Reports That Fly
PPT
Building Reports That Fly
PPTX
[DF2U] Deep Dive into Salesforce.com Reporting, Analytics, and Dashboard
PDF
Alert! Event Notification Options for Force.com Apps Webinar
PPTX
Data Migration Made Easy
PDF
SAP LoadRunner by HP Solution Brief
PDF
Technical App Innovators Webinar (January 18, 2017)
PPTX
Truth of Demand Supply Planning - Demantra
The Need for Speed: Building Reports That Fly
Building Reports That Fly
[DF2U] Deep Dive into Salesforce.com Reporting, Analytics, and Dashboard
Alert! Event Notification Options for Force.com Apps Webinar
Data Migration Made Easy
SAP LoadRunner by HP Solution Brief
Technical App Innovators Webinar (January 18, 2017)
Truth of Demand Supply Planning - Demantra

What's hot (20)

PDF
Integrating SIS’s with Salesforce: An Accidental Integrator’s Guide
PPTX
Oracle demantra online training
PDF
Application Test Management and Quality Assurance
PDF
SAP S/4 HANA Information Sheet
PDF
Capture and Feed Telecom Network Data and More Into SAP HANA - Quicky and Aff...
PPTX
Trinamix demantra data manager
PPTX
TRINAMIX - AMIT SHARMA - Demantra Vs Oracle Demand Planning
PPT
Demantra Case Study Doug
PPT
Application Portfolio Assessment Tool
PDF
Real-Time Operational Reporting for Oracle E-Business Suite with CS*Rapid
PPTX
Analyze billions of records on Salesforce App Cloud with BigObject
PPT
Sage Accpacv5.6 Whats New
PPTX
Integrating Salesforce with Microsoft Office through Add-ins
PDF
Build a Lightning Reporting App with the Salesforce Analytics API
PPTX
Oracle VCP Training - Oracle Value Chain Planning
PPTX
Simple Salesforce Data Migration
PPT
Trusted Reliability & Performance with the AppExchange Platform
PDF
Simplify Complex Consolidations and Close Processes with Oracle Financial Con...
PPT
Optimizing Callidus TrueComp Suite: Tips and Tricks
PDF
Writing Code to Work Against any Salesforce Object
Integrating SIS’s with Salesforce: An Accidental Integrator’s Guide
Oracle demantra online training
Application Test Management and Quality Assurance
SAP S/4 HANA Information Sheet
Capture and Feed Telecom Network Data and More Into SAP HANA - Quicky and Aff...
Trinamix demantra data manager
TRINAMIX - AMIT SHARMA - Demantra Vs Oracle Demand Planning
Demantra Case Study Doug
Application Portfolio Assessment Tool
Real-Time Operational Reporting for Oracle E-Business Suite with CS*Rapid
Analyze billions of records on Salesforce App Cloud with BigObject
Sage Accpacv5.6 Whats New
Integrating Salesforce with Microsoft Office through Add-ins
Build a Lightning Reporting App with the Salesforce Analytics API
Oracle VCP Training - Oracle Value Chain Planning
Simple Salesforce Data Migration
Trusted Reliability & Performance with the AppExchange Platform
Simplify Complex Consolidations and Close Processes with Oracle Financial Con...
Optimizing Callidus TrueComp Suite: Tips and Tricks
Writing Code to Work Against any Salesforce Object
Ad

Viewers also liked (10)

PDF
A Fisherman's Monument, The Drake
PPTX
PPTX
Cladirea bisericii de la trecut la prezent - ELIM Piatra Neamţ
PDF
Monthly reports
PDF
Feedback on the COSO Enterprise Risk Management 20160929 Final
PPTX
байтакова адия будущее-решение
PPTX
COMM 125 Portfolio
PDF
Priyanka nandwani participate kaosal vikash mela as a training partner
PDF
Ch03
PDF
Mostafa Gamal - Portfolio
A Fisherman's Monument, The Drake
Cladirea bisericii de la trecut la prezent - ELIM Piatra Neamţ
Monthly reports
Feedback on the COSO Enterprise Risk Management 20160929 Final
байтакова адия будущее-решение
COMM 125 Portfolio
Priyanka nandwani participate kaosal vikash mela as a training partner
Ch03
Mostafa Gamal - Portfolio
Ad

Similar to Publishing Data to REST APIs with Lightning Process Builder (20)

PPTX
Salesforce Integration using REST SOAP and HTTP callouts
PPTX
SFDC Outbound Integrations
DOCX
Salesforce Integration
PPTX
Integration study group 2: Patterns
PDF
June 2023 Architect Group FTW.pdf
PPTX
Episode 9 - Building soap integrations in salesforce
PPTX
Secure Development on the Salesforce Platform - Part 3
PDF
Salesforce Winter 23 Release Webinar Slide Deck
PDF
SalesForce WebServices part 2
PPTX
Salesforce Integration Pattern Overview
PPTX
Go Faster with Process Builder
PDF
Api apex rest
PDF
Integration playground 20190211
PPTX
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
PPTX
#ImpactSalesforceSaturday:360 degree view of salesforce integrations
PPTX
Big Picture Digital Atlanta Salesforce Nonprofits User Group presentation 3-2...
PPTX
Big Picture Digital Atlanta Salesforce Nonprofits User Group presentation 3-2...
PPTX
Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...
PDF
Getting Started With Apex REST Services
PPTX
Mastering-Salesforce-Development-A-Comprehensive-Overview (1).pptx
Salesforce Integration using REST SOAP and HTTP callouts
SFDC Outbound Integrations
Salesforce Integration
Integration study group 2: Patterns
June 2023 Architect Group FTW.pdf
Episode 9 - Building soap integrations in salesforce
Secure Development on the Salesforce Platform - Part 3
Salesforce Winter 23 Release Webinar Slide Deck
SalesForce WebServices part 2
Salesforce Integration Pattern Overview
Go Faster with Process Builder
Api apex rest
Integration playground 20190211
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
#ImpactSalesforceSaturday:360 degree view of salesforce integrations
Big Picture Digital Atlanta Salesforce Nonprofits User Group presentation 3-2...
Big Picture Digital Atlanta Salesforce Nonprofits User Group presentation 3-2...
Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...
Getting Started With Apex REST Services
Mastering-Salesforce-Development-A-Comprehensive-Overview (1).pptx

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
KodekX | Application Modernization Development
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Electronic commerce courselecture one. Pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Spectroscopy.pptx food analysis technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Machine learning based COVID-19 study performance prediction
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Big Data Technologies - Introduction.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
cuic standard and advanced reporting.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Programs and apps: productivity, graphics, security and other tools
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Electronic commerce courselecture one. Pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
MYSQL Presentation for SQL database connectivity
Spectroscopy.pptx food analysis technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Network Security Unit 5.pdf for BCA BBA.
Machine learning based COVID-19 study performance prediction
sap open course for s4hana steps from ECC to s4
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Big Data Technologies - Introduction.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
cuic standard and advanced reporting.pdf

Publishing Data to REST APIs with Lightning Process Builder

  • 1. Publishing Data to REST APIs with Lightning Process Builder Scott Coleman Principal Solutions Architect, Cloud Giants scott@cloudgiants.com @scottsalesforce alex@cloudgiants.com @KenneyAlexandra Alex Kenney Solutions Consultant, Cloud Giants
  • 2. Welcome to Dreamforce Why implement simple data integrations using Process Builder and Invocable Apex? • Maximum use of platform features, filling gaps with code when necessary • Using clicks instead of code increases maintainability and reusability Key takeaways • REST web service basics • A mostly clicks approach to simple integration • A process and some code that you can use right away! • How to decide if this approach is for you - this isn't the only way (and isn't always the best way) • Ideas about extending the solution to meet your specific needs Thanks for joining us!
  • 3. REST Web Services and APIs What is an API? • Application Programming Interface • Defines the interface between one component and second component that provides services for it What is REST? • Representational State Transfer • An architectural style that can be applied to APIs (most commonly on the web); a set of conventions or rules • Emphasis on lightweight payloads and predictable behaviors REST API examples • Slack webhooks • Google Maps Geocoding API • Salesforce REST API A (Very) High Level Introduction
  • 4. Calling Apex from Process Builder Process Builder - have you used it? You can call Apex methods from your process! • Powerful way to create mostly-declarative solutions • A chance for collaboration between admins and devs • Use the "Apex" action type in Process Builder, select the method to call, and specify the values to pass into the method There are rules for your Apex class and method. It must: • Method should be annotated with @InvocableMethod • Only accept one List as its input parameter (though it can be custom type - use @InvocableVariable on members of user-defined types) • Be static and public/global The Basics
  • 5. Slack Integration Demo Slack is a popular communication tool used by companies, project teams, other organizations Possible use case: Notify your team when a hot lead lands in Salesforce Let's run through a quick demo of this simple Salesforce to Slack integration
  • 6. Slack Integration Slack configuration • Define a webhook and specify which channel messages should appear in • Take note of the webhook address Responsibilities of our Process Builder process • Know when to send a notification (criteria) • Specify what data should be included in the notification • Specify the address of the Slack webhook to which the notification should be sent Configuration
  • 7. Slack Integration Process Builder Let's walk through our process!
  • 8. Slack Integration Not coupled to any particular object or webhook address • Labels, values, and address passed in by process • Same class can be used with any object that supports Process Builder • Make sure to create a Remote Site in Salesforce for https://hooks.slack.com Very simple implementation with basic capabilities • Data structure is flat - not hierarchical • Number of fields you can include in notification is limited • Optional record link can be included so user can get more details • Works great for most quick notifications Apex Class
  • 10. Extending the Solution Is this pattern right for you? • Great for productivity features - not the best solution for reliable messaging, guaranteed delivery, business critical scenarios Payload format • Slack's webhook uses a JSON (JavaScript Object Notation) payload, but your REST endpoint may use a different format • We're using a very flat data structure - maybe your target requires a hierarchical structure Authentication • Slack's webhook REST endpoint doesn't implement any authentication, but your target endpoint likely does • Consider using Named Credentials (Spring '15 feature) to make your code simpler (more on this later) Let us know how you extend the solution (or let us know if we can help!) • Session Chatter feed, Twitter, Email Meet your specific needs
  • 11. Salesforce-to-Salesforce Integration Demo Possible use case: Publish new accounts from one org to another Let's run through a quick demo of this basic Salesforce to Salesforce integration
  • 12. Named Credentials What are they? • A configuration item that allows you to define the credentials that should be used when making a callout to a particular external service, either per user or for all users Why are they useful? • Simplifies your Apex code by managing non-trivial authentication flows for you, like OAuth 2.0 • Keeps the endpoint address in one place, outside of your process and Apex code What else is needed to make this work in our use case? • A Connected App defined in the target org to grant access • An Auth Provider defined in the source org to be used by the Named Credential for authentication in the target org An Introduction
  • 13. Salesforce-to-Salesforce Integration Responsibilities of our Process Builder process • Similar to our first use case • Know when to send a notification (criteria) • Specify what data should be included in the notification • Specify the Salesforce API endpoint to which the notification should be sent (and the credentials to be used) • Used Named Credentials for this Configuration
  • 15. Salesforce-to-Salesforce Integration Not coupled to any particular object or org • Labels, values, named credential passed in by process • Same class can be used with any object that supports Process Builder Not appropriate in scenarios where data is business critical and we need guaranteed delivery • This approach is best for informational integrations and data that isn't business critical (productivity) Apex Class
  • 16. Salesforce-to-Salesforce Integration Apex Class Let's dive into the code and related authentication config!
  • 17. Resources Get the Process, Code, and Step-by-Step Instructions • Available at GitHub: https://github.com/scott-cloudgiants/df16-procbuilder-restapi Salesforce Documentation • Lightning Process Builder • https://help.salesforce.com/HTViewHelpDoc?id=process_overview.htm • InvocableMethod Annotation • https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm • Apex Web Services and Callouts • https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts • Named Credentials as Callout Endpoints • https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_named_credentials.htm Blog Posts • Slack and Salesforce Integration by Christophe Coenraets - the inspiration for our approach! • http://coenraets.org/blog/2016/01/slack-salesforce-integration/ • Salesforce to Salesforce integration using Named Credentials in 5 lines by Jitendra Zaa - more inspiration! • http://www.jitendrazaa.com/blog/salesforce/salesforce-to-salesforce-integration-using-named-credentials-in-just-5-lines-of-code/
  • 19. Thank Y u Scott Coleman Principal Solutions Architect, Cloud Giants scott@cloudgiants.com @scottsalesforce Alex Kenney Solutions Consultant, Cloud Giants alex@cloudgiants.com @KenneyAlexandra