Use HTTP Callout In Salesforce Flow : Bijay Kumar

Use HTTP Callout In Salesforce Flow
by: Bijay Kumar
blow post content copied from  SalesForce FAQs
click here to view original post



### Summary of the Content The article discusses how to validate email addresses in Salesforce using HTTP Callouts within Salesforce Flows. When a new lead is created, it’s essential to check if the email provided is valid before assigning it to the sales team. Instead of writing Apex code, the author used an HTTP callout to an external email validation API, which returns a deliverability status (like "deliverable" or "undeliverable") along with a quality score. ### Key Steps to Implement HTTP Callout in Salesforce Flow: 1. **Create Named Credentials**: This involves setting up a secure connection to the external email validation API by storing authentication details, such as API keys. 2. **Create a Permission Set**: Assign this permission set to users to grant them access to the external credential. 3. **Create a Screen Flow**: - Start a new flow and add a screen for user input. - Use the HTTP Callout element to connect to the email validation API. - Configure the callout to retrieve the email validity status. - Add decision elements to check the response and display the validation results to the user. 4. **Testing and Deployment**: After debugging the flow, it can be activated and added to Salesforce pages for user access. ### Additional Context HTTP Callouts in Salesforce Flow allow users to interact with external systems without needing to write code, making it accessible for admins and consultants. This feature enhances Salesforce's automation capabilities, enabling real-time data validation and improving overall efficiency in business processes. ### Conclusion The article provides a practical guide on using HTTP Callouts in Salesforce Flow for email validation, demonstrating how to streamline processes without coding. ### Relevant Hashtags for SEO #Salesforce #SalesforceFlow #EmailValidation #HTTPCallout #LowCode #SalesforceAutomation #APIs #SalesforceTutorial #CRM #BusinessProcessAutomation


While working on Salesforce Flows, I had a requirement to check if the email entered by a user is valid or not.

For example, when a new lead is created, we want to verify if the email provided is real and active before assigning it to the sales team. Instead of using Apex code, I used an HTTP callout in the flow to send the email address to an external email validation API.

The API responded with a deliverability status, such as “deliverable” or “undeliverable”, along with the quality score of the email. Based on that response, the flow decided whether to continue or show an error message to the user.

In this tutorial, we will learn about the HTTP Callout in Salesforce Flow. I will explain it using a real-time example and also show how to create a flow to use an HTTP callout.

What is HTTP Callout in Salesforce Flow?

The Salesforce Flow helps users automate business processes without writing code. Sometimes, during a process, we may need to send or receive data from another system outside of Salesforce, such as checking email validity, weather information, or updating data in another app.

An HTTP Callout is a method for Salesforce to communicate with another system over the internet using an API. It sends a request (like asking a question) and waits for a response (the answer).

Why Use HTTP Callout in Salesforce Flow?

Earlier, you had to use Apex code to make API requests. But now, with the “HTTP Callout” element in Flow, you can do this without writing any code. It’s low-code and perfect for admins or consultants who don’t know Apex.

How to Use HTTP Callout In Salesforce Flow

Below, I will explain all the prerequisites and how to create a flow to an HTTP callout to communicate with another system over the internet using an API.

1. Create Named Credentials in Salesforce

First, we need to create a new external credential to connect with external systems (like APIs) securely.

Named Credentials in Salesforce

It stores the login or authentication details (like API keys or tokens) safely, so you don’t have to hard-code them in your flow or Apex code. This ensures secure and easy communication between Salesforce and other systems.

External Credentials in Salesforce

Then we need to create the principal in the external credential to define who is making the callout to the external system. Here, I provided the parameter name as Email Validation Principle.

External Named Credentials in Salesforce

After that, we need to create a Named Credential in Salesforce to store the endpoint URL and link it with authentication (External Credential) in a secure and reusable way.

Create Named Credentials in Salesforce

I have created an account with the Abstract API, an external platform used to validate email addresses. Here, we need the GET method, URL, API key, and email address.

Here, you need to copy the URL to add in the named credential.

Email Validation API Key for Callout

Paste the copied URL, select the external credential you created, and save it.

Create New Named Credentials in Salesforce

2. Create a Permission Set for the User

Initially, the user doesn’t have external credential principal access, so we need to create the permission set and assign it to the user.

Assign Permission Set to User in Salesforce

3. Create Screen Flow to Use HTTP Callout

According to the scenario, we wanted to validate the email address that the user provides when creating the record and display the status. For this, we need to create a screen flow.

Go to Setup -> in quick find search for Flow -> New Flow -> Start From Scratch -> Screen Flow -> Next.

Add a Screen element and drag the Email component onto the screen.

Create Screen Flow in Salesforce

Then, click the footer and change the Finish button label to “Validate Email“.

Screen Properties in Salesforce Flows

After that, add the Action element to create the HTTP Callout.

Add Action Element in Salesforce Flow

We need to provide the new HTTP Callout name and select the Named Credential that we created for the validated email.

After that, you will see the URL that we added in the named credential.

HTTP Callout in Salesforce Flow

Then, select the GET method for the HTTP Callout action, as we are retrieving the email validity status from the external system.

Then, in the URL Path, we need to provide the path from the external system. For that, you need to navigate the Abstract API, where you will find the GET URL path.

Get Method in HTTP Callout in Salesforce Flow

Then we need to add a key to communicate with the external system. To do this, click the Add Key button. We need to provide the API key and our email address to the system for validation.

For that, I added two key fields: API key and email. Then click the Next button.

Salesforce Flow HTTP Callout

After that, to obtain a response from the external system, we need to provide a response code for this action; for that, select ‘Use Example Response‘.

How to HTTP Callout in Salesforce Flow

After that, to retrieve the response code again, navigate to the abstract API, copy the response code, and paste it into the Sample JSON Response field.

Then, in the Dara Structure, you will find the fields that are contained in the response.

Salesforce Flow to HTTP Callout

Now we need to provide an API key to the action element to communicate with the external system.

For this, we need to create a New Resource type Variable, provide the API Name to it, select ‘Text‘ as the Data Type, and then copy the API Key from the external system and paste it into the Default Value.

Create New Resource Variable in Salesforce Flow

Now, in the Set Query Parameter Values section, we need to provide the API key and email values.

In the API key value, we need to select the variable that we created in the previous step. In the email field, we need to provide the email address that the user is using; for this, we need to select the email from the screen component.

Set Values for HTTP Callout Action in Salesforce Flow

Then add the Decision element to check whether, when you send an email to an external validation API using Salesforce Flow, and the response code is 200, it means everything went well on the API side.

The API successfully received your request and processed it without any errors.

Add Decision Element in Salesforce Flow

After that, we need to display the status of checked email validity, which requires adding the Screen element.

Add the Display Text component on he screen, where we can display the status.

In the display text properties, I want to display the email address, deliverability, and the quality score of the email that we want to validate. We need to provide values from the response for these parameters.

Add Display Text Component to Screen Flow in Salesforce

Now our flow is ready to save. Provide the flow label and the API name, and click on the debug button to test the flow.

How to Create Screen Flow in Salesforce

As I click the debug button, I need to provide my email to validate it. I have provided my email address and clicked the Validate Email button.

Salesforce HTTP Callout Flow

Here, you can see that we received the response we added to the display text component from the screen element. The external system validates the email send status as a response to the Salesforce flow.

Salesforce Flow HTTP Callout Method

Additionally, if I provide a random email address that is not valid, you can see that the status is displayed as ‘undeliverable’.

HTTP Callout using Salesforce Flow

After the flow has been successfully debugged, you can activate it and add it to the Salesforce homepage or record page.

In this way, we can create a Salesforce screen flow that uses an HTTP Callout to communicate with another system over the internet via an API.

Conclusion

I hope you have an idea about the HTTP Callout in Salesforce Flow. I have explained it using a real-time example and also shown how to create a flow to use an HTTP callout. Here, we took the email validation example, which is an external system used to check the validity of an email address from Salesforce.

You may like to read:

The post Use HTTP Callout In Salesforce Flow appeared first on SalesForce FAQs.


June 04, 2025 at 06:50PM
Click here for more details...

=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce