The MQTT Approach

All the implementation based on the REST API was just a first approach, and it’s not the best solution architecture due to the limitations in storage in Thingspeak. Also, REST Api works great if you need a response when the message is Sent in POST or GET. And finally, the solution is not real-time.

All the implementation (included Salesforce + Python scripts) is published in a different branch in Github if you want to check it out.

MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport…

Service layer

The AEP applies the Martin Fowler’s Enterprise Architecture Patterns. The concept is the design with different layers based on defined responsibilities. This is the concept called Separation of Concerns (SOC). And the layers related to this pattern are:

  1. Service layer
  2. Domain layer
  3. Selector layer

In this part, the Service layer will be commented on. The second part is related to the other 2 layers.

At a high level, applications have three things: storage, logic, and a means to interact with them. SOC requires some upfront thinking about the internal plumbing of your application, including class naming conventions and coding guidelines…

The REST API Approach

General Architecture

Here are the details about the implementation commented on in my previous post. The implementation is based on the Thingspeak REST API.

It’s a prerequisite to check the documentation related to the REST API to understand better how to create the channel and check your APIs keys.

Arduino Code

Though it’s not a post related to Arduino programming (there are very good articles around), I’m going to explain the basic structure of this Arduino development.

In this series of posts, I want to share an IOT project implemented using an ESP32 with an HC-SR501 Movement sensor. For me, it has been an exciting journey to join these two passions: IoT and Salesforce.

So, the basic idea of the project is straightforward: A device that detects movement and sends the information to an IoT Proxy as Thingspeak. Then Salesforce pulls the information from there. In Salesforce could be possible to trigger user events as Email Alerts for instance.

ESP32 is a low-cost, low-power system on a chip (SoC) series with Wi-Fi & dual-mode Bluetooth capabilities! At…

Account data displayed in a PWA implemented with LWC

Go a step ahead by implementing Desktop and…

The final tool for data migration in Salesforce

SFDMU GUI: The main window

SFDX Dataloader is the powerful salesforce data migration tool and it is the innovative and very handy alternative to the traditional Salesforce Data Loader application as well as to the set of the force:data:tree commands.

This SFDX Plugin will help you to populate your org (scratch / dev / sandbox / production) with data imported from another org or CSV files. It supports all important CRUD operations (Insert / Update / Upsert / Delete) also for multiple related sObjects.

It provides the most convenient way to export data from multiple related sObjects between Salesforce orgs (even unlinked).

Domain & Selector layers

Like the Service layer, the Domain Model provides a more granular level of code encapsulation and reuse within your application, such as complex validation, defaulting, and other logic relating to complex calculation and manipulation.

This unit takes a perspective on the Domain Model pattern. It provides guidelines to clearly associate Domain layer code to each custom object, enabling you to further manage effective layering and Separation of Concerns (SOC) within your application codebase. Before we get into what constitutes a Domain class, let’s review where they are used.

  • Apex triggers — Create, read, update, and delete (CRUD) operations, including…

LWC: The most advanced frontend framework in Salesforce

A slot (<slot></slot>) is a placeholder for markup that a parent component passes into a component’s body. The concept is similar to Visual Force’s composition. The idea is basically to use a template structure and reuse it in the different components with different data. Slots are part of the Web Component specification, so it’s a W3C standard.

There are 2 ways to use it:

Unnamed Slots

This example has an unnamed slot. An unnamed slot is a placeholder for any markup that a parent component passes into the body of c-slot-demo.

<!-- slotDemo.html -->
<h1>Add content to slot</h1>

VSC Logo

I’ve been a developer for more than 15 years, I would say that it’s a key goal to maintain a certain level of productivity and improve the quality standards. So I consider that an important part to achieve this is the IDE.

A couple of years ago I discovered the benefits of Visual Studio Code, and it really seemed like a powerful and versatile tool given its plugin scheme that allows any developer to share their experiences with the community.

And that’s where I see VSC’s enormous advantage in having an environment that helps developers to be more productive.


The top-notch stack for frontend in Salesforce named LWC or Lightning Web components has many features that will replace its predecessor (Aura) sooner than later. Here is a clear definition of this framework:

Lightning Web Components uses core Web Components standards and provides only what’s necessary to perform well in browsers supported by Salesforce. Because it’s built on code that runs natively in browsers, Lightning Web Components is lightweight and delivers exceptional performance. Most of the code you write is standard JavaScript and HTML.

Salesforce is committed to developing open web standards and is a member of the World Wide…

Kruk Matias

Informatic Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store