How To Verify API Connection & Perform HTTP Callout in Salesforce Flow

How To Verify API Connection & Perform HTTP Callout in Salesforce Flow

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

In the ever-evolving landscape of customer relationship management (CRM) and enterprise solutions, Salesforce continues to lead the charge with innovative updates and enhancements. The much-anticipated Spring '24 Release brings a plethora of features aimed at empowering users to streamline their workflows and achieve unparalleled efficiency. Among the standout improvements is the revolutionary enhancement to Salesforce Flow, allowing users to verify API connectivity and perform HTTP callouts directly within the platform.

Traditionally, integrating external systems or fetching real-time data from web services within Salesforce Flows has been a multi-step process involving Apex code or external tools. However, the Spring '24 Release marks a paradigm shift by introducing a built-in capability to validate API connections and execute HTTP callouts seamlessly, all within the intuitive and user-friendly environment of Salesforce Flow.

This enhancement not only simplifies the development process but also opens up a new realm of possibilities for administrators, developers, and business users. Now, with just a few clicks, Salesforce users can validate the connectivity of their APIs and effortlessly incorporate external data into their processes, all while harnessing the power of declarative automation.

In this blog post, I will delve into the details of this groundbreaking feature, exploring how it can be configured, its potential applications, and the significant impact it can have on the overall Salesforce user experience. 

The form you have selected does not exist.

Watch The Video Or Read The Article (or do Both)

Salesforce Spring 24 Release Youtube Playlist

📌 Salesforce Spring 24 Release Youtube Playlist – https://bit.ly/3wyAB9I

Prerequisite

Since I am going to build the flow from where I will be calling the API, I need two things. One is definitely the API which I will be calling and the second one is to configure Named, External Credentials and add them to the Permission Set. Finally I need to assign the permission set to my user record so that I can call the flow and perform HTTP callout.

API that I will be calling is called Bored API. The Bored API helps you find things to do when you're bored! There are fields like the number of participants, activity type, and more that help you narrow down your results.

Link: https://www.boredapi.com/

For the second one to configure Named, External Credentials and add them to the Permission Set, I have dedicated blog post/video which you can read.

Link: How to add Named Credentials to Permission Set using Pricipals

 

Let's Build The Flow

Let's first start with a screen flow. In the first step, I will create a screen and inside the screen, I will be using a Display Text component with the message - Do you want to know what you can do next?

Now in the next step, I will add an Action element. Within the action element window, I will select Create HTTP Callout. Here I will be creating the external service and also select the named credential that authorizes the connection between Salesforce and the API. Note - Bored is the name of my Named Credential.

Now in the next screen, I will configure HTTP callout method and details for the invocable action. In my case, I am labelling it as GetBoredCall. This is going to be a GET call, so I choose GET under Method. Finally in the URL Path, I am going to put /api/activity to complete it.

In the next screen, you will find the new feature that is coming up with Spring 24 release. Here you will get two options to select sample response method. The first one is Connect for schema which establishes a connection to the API endpoint and retrieves a response, generating an accurate, real-time sample response. The second one is to Use Example Response which is nothing bu to configure the sample response by pasting an example API response without establishing a real-time connection to the API endpoint.

I will choose the first option i.e. Connect for schema and click on Next. Here in the next screen, the moment I will click Connect, it will create a real-time call to the system. I will use the response from the selected system to configure the HTTP Callout. As you can see in the below screenshot, based on the response, the Data Structure is already being populated.

In the next screen, I will configure the action by giving it a name and label. Finally I will click on Done.

Finally, I will put one more screen to display the result of the API which is basically some sort of recommendation to come out of the boredom. Lastly, I will save and activate the flow.

Let's Run The Flow

When I will run the flow, it will perform HTTP callout and fetch the recommendation, which I will display in the flow screen.

Conclusion

In conclusion, Salesforce's Spring '24 Release represents a pivotal moment in the evolution of the platform, with the introduction of a game-changing enhancement to Flow. The ability to validate API connectivity and execute HTTP callouts directly within Salesforce Flow marks a significant stride towards simplifying and democratizing the integration process. This newfound capability not only streamlines development but empowers users across roles to effortlessly bring external data into their workflows. As organizations strive for agility and efficiency in their operations, the Spring '24 Release propels Salesforce Flow into a central role, where it becomes not just a workflow automation tool but a dynamic hub for seamless API interactions. 

I will be publishing more blogs and videosc around Spring 24 Release. So please subscribe to my blog and youtube channel

📌 Salesforce Spring 24 Release Youtube Playlist - https://bit.ly/3wyAB9I

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

Bookmark These Useful Google Cloud Resources

Bookmark These Useful Google Cloud Resources

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

Embarking on a Google Cloud journey as a Cloud engineer, data engineer, architect, or DevOps engineer? Navigating the vast expanse of resources can be overwhelming. Fear not! In this post, I have curated a list of five must-know resources tailored just for you. Whether you're a seasoned professional or a newcomer, these tools will serve as your compass in unlocking the full potential of Google Cloud.

The form you have selected does not exist.

Google Cloud Cheatsheet

Access all Google Cloud services in one place! Perfect for quick reference and streamlined navigation. Check it out:

https://googlecloudcheatsheet.withgoogle.com/

Python Google Cloud Client Libraries

Automate tasks efficiently with comprehensive Python libraries for Google Cloud. Get started: 

https://cloud.google.com/python/docs/reference

Google Cloud Python Samples

Kickstart your Google Cloud journey with diverse Python samples! Build and deploy your first app or data pipeline effortlessly. Explore more:

https://github.com/GoogleCloudPlatform/python-docs-samples

Prebuilt Terraform Modules

Accelerate your Google Cloud Adoption/Migration with modular Terraform modules! Create your Google Cloud Landing Zone seamlessly. Dive in:

https://github.com/terraform-google-modules

https://github.com/GoogleCloudPlatform/cloud-foundation-fabric

Google Cloud Professional Services Tools

Discover common solutions and tools crafted by Google Cloud's Professional Services team! Explore the possibilities:

https://github.com/GoogleCloudPlatform/professional-services

 

Conclusion

I hope this post will help to choose solutions that fit bests for your requirement. If you have any question/feedback or if you have any other solution, please let me know in the comment section. Thank you and happy learning.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

How To Display Uploaded File Names in Salesforce Flow

How To Display Uploaded File Names in Salesforce Flow

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

Understand The Requirement

Let's unlock the full potential of Salesforce Flow with this latest blog post, as I delve into the seamless integration of the out-of-the-box Flow Upload component.

While Salesforce Flow simplifies the file upload process, there is a common challenge: the default setup lacks visibility on successfully uploaded files once the popup window is closed. This blog post addresses this issue by providing a swift and effective configuration solution. In this blog post, I will guide you through the steps to enhance your user experience, enabling the display of successfully uploaded file names directly on the Flow screen. Elevate your Salesforce Flow capabilities with this invaluable insight and configuration technique.

Watch The Video Or Read The Article (or do Both)

The form you have selected does not exist.

Let's Start With The Screen Flow

  • Let's add a static text in the screen asking user - "Do you want to upload some files?"
  • Right next to the text, let's drag and drop the standard File Upload component.

Let's Configure File Upload Component

  • Let's give it a name as fileUpload. But you can give any name.
  • Let's put the message under File Upload Label as Let's Upload Your Files Here.
  • Let's make it True for Allow Multiple Files.

Let's Print The Name Of The Uploaded File(s)

Once the File Upload component is comfigured, let's bring Display Text component right below the File Upload component. Give it a name as displayAllNames.

Now the main part. The actual message that you want to display is the name of the successfully uploaded files, right?

The standard File Upload component provides a variable called fileNames which basically holds the name of the all successfully uploaded file names in comma-separated format. The way to access the variable inside your flow is:

{!<FILE_UPLOAD_COMPONENT NAME.fileNames}

So in my case, I will put {!fileUpload.fileNames} as fileUpload is the name of my File Upload Component.

It will look like -

And That's All !!

That's all you need to configure inside your flow. Isn't it so easy? Now the upload file names will be displayed like this -

Conclusion

In conclusion, this exploration of Salesforce Flow's capabilities has illuminated the power of the out-of-the-box Flow Upload component in seamlessly handling file uploads and printing their names. 

However, armed with this insightful blog post, you now possess a quick and effective configuration solution. By implementing the provided steps, you can enhance your user experience and gain clarity by having the names of successfully uploaded files prominently displayed on the Flow screen.

As you navigate the dynamic landscape of Salesforce Flow, keep in mind that optimizing your configurations can significantly impact efficiency and user satisfaction. I hope this blog post serves as a valuable resource, empowering you to harness the full potential of Salesforce Flow and streamline your file upload processes.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

Restrict Uploading Files In Salesforce

Restrict Uploading Files In Salesforce

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

Watch The Video Or Read The Article (or do Both)

Understand The Requirement

While working in Salesforce, we sometimes come up with the requirements where we need to build some sort of validation to restrict uploading files with specific extensions or in other words, allow only approved file types/extensions. This is very important because uploading executing or javascript code can bring potential security concerns by exposing internal data to outside world.

So allowing only certain type of files for upload is a very common requirement. In this blog post, I am sharing couple of solutions with pros and cons to implement this requirement.

The form you have selected does not exist.

Understand The Places From Where We Can Upload Files

We can upload files from these below different places in Salesforce.

  • Upload from any record's Notes & Attachment related list.
  • Upload from Chatter notes.
  • Upload from Experience Cloud page.
  • Upload from Screen Flow using Salesforce's Upload component.
  • Upload from any custom lightning web component.

Understand Solution For Each Of The Above Scenarios

  • When uploading from any record’s Notes & Attachment related list, you can create validation rule to restrict.
  • When uploading from Chatter note, you can create Apex Trigger to restrict.
  • When uploading from Experience Cloud pages, you can create Apex Trigger to restrict.
  • When uploading from Flow Screen, you can configure flow upload component to allow certain type of files only.
  • When uploading from custom built lightning web component, you can check the type of files inside your lightning web component code.

Solution Approach - I (Declarative Approach)

We can create a validation rule on Content Version Object to check for FileType and if the type of the file is not any of blocked file type, we can throw the error message. This solution is a very straight forward declarative implementation. The validation rule will look something like -

Even though this solution looks very straightforward, there are couple of limitations with this solution.

  • With this approach we can not modify the error message. The error message you mention in the validation rule will not appear, rather error message will always be like – Can’t upload Filename
  • The validation rule for ContentVersion object works on desktop browser, but does not work on experience site using mobile browser. Solution is to implement/use apex trigger against ContentVersion object. (Refer: this)

Solution Approach - II (Flow)

In this approach, when we will use the file upload component inside your screen flow, we need to configure to include allowed file types.  In the Accepted Formats field, enter a comma-separated list of the file extensions that users can upload.

Solution Approach - III (Apex - Programmatic)

In this approach, we can create the trigger on ContentVersion object or FeedItem object to check for the File Type (after context) and throw the error message. Before implementing this, it makes sense to understand the related objects quickly

Understand Related Objects

Three distinct objects—ContentVersion, ContentDocument, and ContentDocumentLink—underlie the Files data model. In the simplest terms imaginable, this is what they stand for:

  • In Salesforce, a single file is represented by the parent object of ContentVersion and ContentDocumentLink, which is ContentDocument.
  • All of the file's versions, both historical and current, are represented by ContentVersion records.
  • ContentDocumentLink denotes the connection to the entities—users, groups, records, or libraries—with which the file is shared.

Trigger On ContentVersion Object

We can write the trigger on ContentVersion object as shown below. In this scenario, my trigger is allowing only certain type of files to be uploaded.

Trigger On FeedItem Object

If users are uploading documents from feed, we need to write trigger in FeedItem object to restrict or allow certain type of files. Sample code is shown below where I am allowing certain type of files to be uploaded.

Conclusion

I hope this post will help to choose solutions that fit bests for your requirement. If you have any question/feedback or if you have any other solution, please let me know in the comment section. Thank you and happy learning.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

How To Prepare For Google Cloud Digital Leader Certification

How To Prepare For Google Cloud Digital Leader Certification

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

Are you ready to elevate your career in the cloud computing landscape? The Google Cloud Digital Leader Certification is your gateway to demonstrating expertise in cloud technologies and strategic leadership. This certification not only validates your proficiency in Google Cloud but also showcases your ability to guide organizations through their digital transformation journey.

I have cleared this certification. So in this blog post, I am going to share all my notes, study references. Hoping that it will help you to clear this certification as well.

Also I will be publishing videos in my youtube channel covering topics from this certification. So please subscribe to my youtube channel so that you will get to know about my upcoming videos.

Youtube Channel Link - technical potpourri

The form you have selected does not exist.

My Certification 🎉

Understanding The Certification

Before diving into the preparation process, it's essential to grasp the fundamentals of the Google Cloud Digital Leader Certification. This certification is designed for professionals who want to showcase their strategic thinking and leadership skills in the context of cloud technologies. It's not just about technical prowess; it's about understanding how to leverage cloud solutions for business success.

Key Areas Of Focus

1. Cloud Concepts And Principles

Start by building a solid foundation in cloud concepts. Understand the key principles that underpin cloud computing, including scalability, elasticity, and cost optimization. Familiarize yourself with the core services offered by Google Cloud Platform (GCP).

2. Leadership And Strategy

The Digital Leader Certification emphasizes strategic thinking. Explore case studies and real-world scenarios to develop a keen understanding of how cloud technologies can be strategically applied to address business challenges. Focus on aligning cloud solutions with organizational goals and objectives.

3. Security And Compliance

Security is paramount in the cloud. Delve into Google Cloud's security features and best practices. Understand how to implement robust security measures and ensure compliance with industry standards. This knowledge is crucial for any leader guiding their organization's digital journey.

4. Data Analytics And Machine Learning

Gain insights into data analytics and machine learning capabilities within GCP. Understand how organizations can derive value from data, make informed decisions, and leverage machine learning for innovation.

Preparation Strategies

1. Official Documentation And Learning Paths

Start by exploring the official Google Cloud documentation. Follow the recommended learning paths provided by Google Cloud to cover all the essential topics. The documentation is regularly updated, ensuring you stay current with the latest features and best practices.

2. Hands-On Labs And Projects

Apply theoretical knowledge by engaging in hands-on labs and projects. Google Cloud provides a platform for you to experiment with various services in a controlled environment. Practical experience enhances your understanding and retention of key concepts.

3. Online Courses And Tutorials

Explore online courses and tutorials offered by reputable platforms. These resources often provide structured learning paths and expert guidance, helping you navigate the vast landscape of Google Cloud services.

4. Practice Exams

Familiarize yourself with the exam format by taking practice exams. This not only helps you understand the types of questions you might encounter but also aids in time management during the actual exam.

Certification Structure

  • Length: 90 minutes
  • Registration fee: $99
  • Language: English, Japanese
  • Exam format: 50-60 multiple choice and multiple select questions
  • Official Link: Click here

You can watch the below video to get yourself introduced with the certification

Topics Covered In The Exam

You can read the topics by going into the official link here.

Flashcards

Using flashcards for self-testing is a fairly successful strategy. You have the option to create your own or look for pre-made ones on Quizlet by typing in "Google Digital Leader." They are quite helpful in understanding how each Google Product works. Alternatively, Google offers an interactive cheatsheet wall with every product that is accessible to the general public.

Important Resources 

  1. Google Cloud Digital Leader Exam Guide: This guide provides an overview of the exam, including the topics covered, the format of the questions, and tips for preparation. You can find it here: https://cloud.google.com/certification/guides/digital-leader
  2. Google Cloud Certified – Digital Leader Training: This training program is designed to help you prepare for the exam. It covers the same topics as the exam and includes hands-on labs to help you gain practical experience with Google Cloud Platform products and services. You can access the training program here: https://cloud.google.com/training/certification/digital-leader
  3. Google Cloud Documentation: The Google Cloud documentation provides detailed information about all of the Google Cloud Platform products and services. It is a valuable resource for studying the topics covered on the exam. You can access the documentation here: https://cloud.google.com/docs/
  4. Google Cloud Certified Community: Joining the Google Cloud Certified Community is a great way to connect with other individuals who are preparing for Google Cloud exams. You can ask questions, share tips and resources, and get support from other community members. You can access the community here: https://cloud.google.com/certification/community
  5. Google Cloud Console: The Google Cloud Console is a web-based user interface that you can use to manage your Google Cloud Platform resources. It is a valuable tool for gaining practical experience with Google Cloud Platform products and services. You can access the console here: https://console.cloud.google.com/
  6. Youtube Channel - technical potpourri: I keep on updating contents around Google Cloud Certification topics in my youtube channel. So  you can subscribe to my channel to get notified when I will publish new contents. Subcribe here.

Sample Questions

I would highly recommend doing Google's own free sample questions to help you get a better gauge of where you stand.

Final Thoughts

Preparation for the Google Cloud Digital Leader Certification is not just about memorizing facts; it's about developing a holistic understanding of cloud technologies and honing your strategic leadership skills. Embrace a combination of theoretical learning, practical application, and strategic thinking to unlock success on your certification journey.

Remember, becoming a Google Cloud Digital Leader is not just about passing an exam; it's about positioning yourself as a leader in the dynamic world of cloud computing.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments