Development tools
Oleg Zankov
CEO Latenode, No-code Expert
September 26, 2023
A low-code platform blending no-code simplicity with full-code power 🚀
Get started free
September 26, 2023
‱
6
min read

JavaScript + AI: a Perfect Duo for Low-code Automations

Oleg Zankov
CEO Latenode, No-code Expert
Table of contents

Hello! I'm Oleg Zankov, CTO & founder of Latenode – a cloud-based low-code platform where you can easily create adaptable business process automations and build web services without the hassle of managing any infrastructure. Whether you're an experienced automation expert or a non-tech business owner aiming to figure out how to automate businesses, this article introduces a free AI tool designed to save you tons of time and effort within your low-code journey.

‍

‍

In this article, we’ll uncover the unlimited possibilities of our JavaScript node combined with an AI Assistant that allows you to build integrations with any web service or flexibly transform data—all within minutes. With two seamless options for using our AI-powered JavaScript module, you can access the AI Node for quick setup or dive into the JavaScript Node directly for more control.

We’ve designed Latenode so that even if you’re completely new to coding, you’ll be able to work with it smoothly and create custom solutions tailored to your needs.

We provide a seamless experience for JavaScript. With Latenode, you can explore AI with JavaScript and even experiment with JavaScript + AI. Our aim is to make these cutting-edge technologies accessible to all developers, regardless of their level of expertise in JavaScript or AI.

Latenode Platform Interface

There’s a new addition within the JavaScript module that’s extremely useful for development. It's an AI Assistant designed to help with a wide variety of coding tasks, such as:

  • Code writing
  • Debugging
  • Code explanation
  • Modifications on request

Moreover, our JavaScript node supports custom fields and authorization fields, allowing you to avoid direct code editing—a feature that’s particularly helpful for beginners who might feel intimidated by code. Instead, all necessary variables can be added through simple fields, making JavaScript integration up to ten times easier to manage and customize.

How to Use Latenode AI Assistant?

Our two-step approach to integration makes it easy for beginners and flexible for advanced users:

AI Node: This is the first step, ideal for users who want to get started quickly. Simply describe the task, and the AI will generate all necessary code, fields, and authorization settings. This hands-free option is perfect for building integrations rapidly without getting into code.

JavaScript Node: Once comfortable with AI Node, you can move on to the JavaScript Node for more tailored control. Here, the AI Assistant helps within the JavaScript module, guiding code creation, troubleshooting, and custom adjustments as needed. You interact through the 'AI Chat' window for this support.

The Assistant’s capabilities include:

  • Viewing your workflow and node structure
  • Analyzing existing code within the JavaScript node
  • Accessing data structures to streamline data management

These options provide flexibility for both beginners and advanced users, letting you choose between a fully automated approach or a more hands-on coding experience with AI support.

Create unlimited integrations with branching, multiple triggers coming into one node, use low-code or write your own code with AI Copilot.

Use Cases

The beauty of the AI Assistant on Latenode is that it represents a huge step toward our mission: now, even those unfamiliar with coding can create their own microservices or build intricate automations. Let’s demonstrate this with three scenarios.

Scenario #1: HTML Tasks

Consider a scenario where you need a data collection form accessible via a webhook URL. This could be handy in numerous situations. Initially, you fill out the form. Then, the data can be routed anywhere: either to another automation branch on Latenode for further transformations or into another system. What about making this scenario without typing a single line of code?

Form for Email Composition Targeting User Database

Step 1. Send a request to the AI assistant: 

Hi! Append my code with a script to generate HTML for a form titled 'create email'. It should have these input fields: 'email subject', 'overview', 'header', 'platform updates', 'useful resources', 'other news'. Place a 'submit' button at the bottom. Beautify the HTML with a pleasing design and proper formatting. Return the result as a JSON object labeled “html”

Step 2. Replace your current code with the received result.

Step 3: Initiate your new scenario once.

The JavaScript module will return the "html" JSON object suitable for webhook responses Besides this, switch the content type parameter to text/html to display the form correctly through our input webhook.

Now, upon accessing your webhook URL as shown before, a data collection form will greet you.

Step 4. Data Submission.

All that remains is to ensure the data collected via the form gets relayed to another scenario's webhook for further processing. Of course, we won’t be coding this manually.

Now, our form becomes fully functional, ready to receive input. You can channel these captured values to another workflow that, for example, logs the collected data into a Google Sheet.

Method #2 JavaScript AI Integration

Write the code even if you are begginer with Latenode's AI Assistant

Using JavaScript for integration might seem more complex, but Latenode's AI Assistant within the JavaScript module makes it accessible for beginners.

To create a new Trello card using AI, ask our assistant the following:

– Add Script to my code that will create an API integration with Trello – "Create a new Card"

The remaining steps are similar to the HTTP method:

  1. Enter your API Key and API Token.
  2. Add the idList of your Trello board.
  3. Specify the Trello card name and Description.

🐞 Encounter a JavaScript error? Don't worry! The AI will help you fix your code once you send the error back to the chat.

You don't even have to explain what you need; sending a raw error will be enough to get new code:

Using this method you choose a self-service approach for any low-code integration you can imagine.

Scenario #2: Access to NPM Packages

There are now over 1.2 million NPM packages (pre-built apps for devs to integrate into their code). Latenode's AI assistant offers you access to these. Suppose you require the current USD/EUR exchange rate for multi-currency trading to provide updated info for your website visitors. Instead of struggling with locating the right API and sifting through documentation, phrase your request like this:

To solve this, the assistant utilizes the NPM library 'axios' to send a GET HTTP request to the ExchangeRate-API, fetching the latest exchange rates. It then retrieves the exchange value of 1 USD to 1 Euro and returns it in JSON format.

Achieving the right result might take a couple of tries: occasional errors or empty return values can occur. The key is to remember that debugging isn't your chore. Ask the AI to integrate console.log for a detailed server response. Then, Report any issue back to the AI chat, and you'll have the revised code in no time.

Scenario #3: Data Transformation

Struggling with data transformation tasks? Say goodbye to those hassles, especially ones like date formatting. We all know how one system may spit out a date in "YYYY-MM-DD" format, but another might require it in “DD MMMM YYYY”.

Using the transformation, a webhook date of '2023-07-11' would look like this:

Likewise, the AI can assist in manipulating strings, aggregating data, filtering, sorting, transforming, merging, splitting, de-duping, conducting statistical analysis, and even textual analysis.

Alternative Mode of Use

In our discussion so far, we approached the assistant via a dialog box. But there's another approach, especially useful for a focused code segment debug or when you need an explanation about code functionality:

Write the code even if you are begginer with Latenode's AI Assistant

Write the code even if you are beginner with Latenode's AI Assistant

The Low-Code Enthusiasts Community

Our community is bustling with activity. As the wave of low-code solutions gathers pace, professionals are joining our forum. We value feedback immensely, and our team is ever-ready to answer your questions!

Join us at Latenode.com and become a part of Latenode community forum

Related Blogs

Use case

Backed by