SlideShare a Scribd company logo
5
Most read
7
Most read
8
Most read
Mulesoft Salesforce Connector
using Data Sense , Message
Enricher
Updating a salesforce object
Use Case- Accept json in HTTP end point and
update corresponding salesforce object.
What we will learn:-
1):- Using HTTP connector and adding
metadata.
2):- Converting JSON to a format which
salesforce can accept.
3):- Message Enricher and using Data Sense.
Mule Flow Diagram
Step 1 - Drag HTTP connector to your mule pallet.
Add Listener configuration . Give any path for ex /test and enter POST in allowed method.
In HTTP connector properties go to section Metadata. You can add metadata here by clicking add metadata .
Add Metadata - > A pop up will appear -> click add on left corner -> Type any id -> select type as json -> select schema
or example -> browse your schema or json sample file - > Click Ok.
Following is example JSON which we have to send for update an existing contact record
having last name “Pandey” in salesforce and we have to update department from IT to
training.
{
"id": "",
"name": “Pandey",
"department":“training"
}
Step 2-To update a salesforce object we need id of that object. We can update only if we
have id with us. So before updating we need Id of contact object . Now drag salesforce
connector to pallet and add connector configuration detail with basic authentication.
Select Operation as Update and sObject Type is contact.
As you select object as Contact Data Sense get all metadata for Contact object of salesforce
for you and this will help to transform your JSON to a format which salesforce can accept.
Step 3 -Now add Transform Message to pallete between HTTP and Salesforce Connector.
You have added metadata to HTTP already in step 1 and Datasense will retrieve Metadata
for salesforce contact object automatically . Now you have to do mapping between HTTP
metadata and Saelsforce metadata by drag and drop :-
• Step 4- Now add a Message Enricher to your pallet and drag salesforce connector inside
Message Enricher. We need Id of contact.Select salesforce connector and change operation to
query and language Data Sense query language and write following query :-
SELECT Id FROM Contact WHERE LastName = '#[payload.get(0).get("LastName")]'
Initially when we used salesforce connector we used operation as update and selected sObjectType
as Contact. We did that to get metadata for contact object so that transform message can be used
graphically to do transformation .
We have to use Message Enricher because we do not want to change payload which we
transformed using Transform Message but we want Id of contact to update Contact object.
In Message enricher we can add source and target . Source is from where data will be retrieved and
target is where this data will be set. We can add multiple source and target as well
Message Enricher limitation is that it can not enrich payload .
• Select Message Enricher and select Source and target as per diagram. Here one thing which is
very important is that in source the payload is what returned from SalesForce query . Its not
original payload which is coming from Transform Data and this payload will not go further.
Message Enricher will create a variable as defined in target and this variable will move with mule
flow.
Step 6 – Add another salesforce object to update sale-force Contact Object. Drag salesforce
connector to pallet and select operation as Update and object as Contact and check create object
manually.
• Click in front of create object manually and add following expression to fields :-
• At end of flow add set Payload and set Payload to ‘success’. Before making call to flow make sure
you have record with Last Name which you are going to send in body of POST request. Now use
any tool like postman.
http://localhost:8081/json
And data for POST request is :-
{
"id": "1",
"name": "Pandey",
"department": "training"
}
Press Send and if everything works fine , check your salesforce object.
Thanks
Yogesh Chandr
Question? -> Email - reachtoyogesh@gmail.com

More Related Content

PPTX
OneDrive for Business - NextGen Client
PPTX
The Data Driven University - Automating Data Governance and Stewardship in Au...
PDF
PPTX
Capgemini Cloud Assessment - A Pathway to Enterprise Cloud Migration
PPTX
Windows Azure Service Bus
PPTX
Customer-Centric Data Management for Better Customer Experiences
PPTX
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
PDF
Best Practices for Streaming IoT Data with MQTT and Apache Kafka®
OneDrive for Business - NextGen Client
The Data Driven University - Automating Data Governance and Stewardship in Au...
Capgemini Cloud Assessment - A Pathway to Enterprise Cloud Migration
Windows Azure Service Bus
Customer-Centric Data Management for Better Customer Experiences
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
Best Practices for Streaming IoT Data with MQTT and Apache Kafka®

What's hot (20)

PDF
Oracle Cloud Infrastructure – Compute
PDF
A cloud readiness assessment framework
PPTX
Azure integration services from the IT Professional perspective
PDF
Preparing, Piloting & Paths to Success with Microsoft Copilot
PPTX
Microsoft power platform
PPTX
Oracle Cloud Infrastructure (OCI)
PDF
Real-Life Use Cases & Architectures for Event Streaming with Apache Kafka
PPTX
Creating Event Driven Applications with Azure Event Grid
PDF
Evolution from EDA to Data Mesh: Data in Motion
PDF
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
PDF
03 power platform power automate in a day-2
PDF
Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...
PDF
Gain 3 Benefits with Delta Sharing
PDF
Democratizing AI/ML with GCP - Abishay Rao (Google) at GoDataFest 2019
PPTX
Dynamics 365 CRM Introduction
PDF
Modern Data Flow
PPTX
Microsoft Introduction to Automated Machine Learning
PPTX
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
PDF
The Heart of the Data Mesh Beats in Real-Time with Apache Kafka
PPTX
Introduction to Power Platform
Oracle Cloud Infrastructure – Compute
A cloud readiness assessment framework
Azure integration services from the IT Professional perspective
Preparing, Piloting & Paths to Success with Microsoft Copilot
Microsoft power platform
Oracle Cloud Infrastructure (OCI)
Real-Life Use Cases & Architectures for Event Streaming with Apache Kafka
Creating Event Driven Applications with Azure Event Grid
Evolution from EDA to Data Mesh: Data in Motion
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
03 power platform power automate in a day-2
Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...
Gain 3 Benefits with Delta Sharing
Democratizing AI/ML with GCP - Abishay Rao (Google) at GoDataFest 2019
Dynamics 365 CRM Introduction
Modern Data Flow
Microsoft Introduction to Automated Machine Learning
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
The Heart of the Data Mesh Beats in Real-Time with Apache Kafka
Introduction to Power Platform
Ad

Similar to Mulesoft salesforce connector to update Object. (20)

DOCX
POSTMAN and Payment Document -API Testing.docx
PDF
Salary advanceworkflow
PPTX
Working with data.pptx
DOCX
ankush_resume
PDF
FDMEE script examples
PDF
FDMEE script examples
PDF
API_Testing_with_Postman
PPTX
Mulesoft - Salesforce Connector
PPTX
Salesforce connector Example
PPTX
Using message enricher
PPTX
Baltimore MuleSoft Meetup #8
PPTX
Mule enricher
PPT
Tunnelpoint Pitch
PPTX
Parameters as a part of body
PPT
Intro to AppExchange - Building Composite Apps
PPT
Mule data weave with flowref lookup
PPTX
Mule enricher
PDF
How to use Informatica Power Center as a RESTful Web Service Client?
PPT
Dataweavewithflowreflookup
PPT
Web forms and html lecture Number 4
POSTMAN and Payment Document -API Testing.docx
Salary advanceworkflow
Working with data.pptx
ankush_resume
FDMEE script examples
FDMEE script examples
API_Testing_with_Postman
Mulesoft - Salesforce Connector
Salesforce connector Example
Using message enricher
Baltimore MuleSoft Meetup #8
Mule enricher
Tunnelpoint Pitch
Parameters as a part of body
Intro to AppExchange - Building Composite Apps
Mule data weave with flowref lookup
Mule enricher
How to use Informatica Power Center as a RESTful Web Service Client?
Dataweavewithflowreflookup
Web forms and html lecture Number 4
Ad

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Empathic Computing: Creating Shared Understanding
PPT
Teaching material agriculture food technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Approach and Philosophy of On baking technology
Digital-Transformation-Roadmap-for-Companies.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Electronic commerce courselecture one. Pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Empathic Computing: Creating Shared Understanding
Teaching material agriculture food technology
20250228 LYD VKU AI Blended-Learning.pptx
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Approach and Philosophy of On baking technology

Mulesoft salesforce connector to update Object.

  • 1. Mulesoft Salesforce Connector using Data Sense , Message Enricher Updating a salesforce object
  • 2. Use Case- Accept json in HTTP end point and update corresponding salesforce object. What we will learn:- 1):- Using HTTP connector and adding metadata. 2):- Converting JSON to a format which salesforce can accept. 3):- Message Enricher and using Data Sense.
  • 4. Step 1 - Drag HTTP connector to your mule pallet. Add Listener configuration . Give any path for ex /test and enter POST in allowed method. In HTTP connector properties go to section Metadata. You can add metadata here by clicking add metadata . Add Metadata - > A pop up will appear -> click add on left corner -> Type any id -> select type as json -> select schema or example -> browse your schema or json sample file - > Click Ok.
  • 5. Following is example JSON which we have to send for update an existing contact record having last name “Pandey” in salesforce and we have to update department from IT to training. { "id": "", "name": “Pandey", "department":“training" } Step 2-To update a salesforce object we need id of that object. We can update only if we have id with us. So before updating we need Id of contact object . Now drag salesforce connector to pallet and add connector configuration detail with basic authentication. Select Operation as Update and sObject Type is contact. As you select object as Contact Data Sense get all metadata for Contact object of salesforce for you and this will help to transform your JSON to a format which salesforce can accept.
  • 6. Step 3 -Now add Transform Message to pallete between HTTP and Salesforce Connector. You have added metadata to HTTP already in step 1 and Datasense will retrieve Metadata for salesforce contact object automatically . Now you have to do mapping between HTTP metadata and Saelsforce metadata by drag and drop :-
  • 7. • Step 4- Now add a Message Enricher to your pallet and drag salesforce connector inside Message Enricher. We need Id of contact.Select salesforce connector and change operation to query and language Data Sense query language and write following query :- SELECT Id FROM Contact WHERE LastName = '#[payload.get(0).get("LastName")]' Initially when we used salesforce connector we used operation as update and selected sObjectType as Contact. We did that to get metadata for contact object so that transform message can be used graphically to do transformation . We have to use Message Enricher because we do not want to change payload which we transformed using Transform Message but we want Id of contact to update Contact object. In Message enricher we can add source and target . Source is from where data will be retrieved and target is where this data will be set. We can add multiple source and target as well Message Enricher limitation is that it can not enrich payload .
  • 8. • Select Message Enricher and select Source and target as per diagram. Here one thing which is very important is that in source the payload is what returned from SalesForce query . Its not original payload which is coming from Transform Data and this payload will not go further. Message Enricher will create a variable as defined in target and this variable will move with mule flow.
  • 9. Step 6 – Add another salesforce object to update sale-force Contact Object. Drag salesforce connector to pallet and select operation as Update and object as Contact and check create object manually.
  • 10. • Click in front of create object manually and add following expression to fields :-
  • 11. • At end of flow add set Payload and set Payload to ‘success’. Before making call to flow make sure you have record with Last Name which you are going to send in body of POST request. Now use any tool like postman. http://localhost:8081/json And data for POST request is :- { "id": "1", "name": "Pandey", "department": "training" } Press Send and if everything works fine , check your salesforce object. Thanks Yogesh Chandr Question? -> Email - reachtoyogesh@gmail.com