Welcome to Xano, a powerful no-code platform that simplifies the process of building and deploying backend services for web and mobile applications. In this guide, we'll explore the basics of working with data in Xano, covering essential concepts such as functions, variables, dot notation, filters, add-ons, and date and time manipulation. Let's dive in!
Functions are at the core of Xano's no-code API builder. They execute actions in a linear fashion, allowing you to perform various tasks such as database requests, data manipulation, caching, external API requests, and more.
To get started with functions, let's create a new API endpoint called "demo":
For this example, we'll add a function to fetch all records from a database table called "content." Here's how:
Now, when you run and debug this API endpoint, you'll receive all the records from the "content" table.
Variables act as containers for information in Xano. They can hold various data types such as text, objects, arrays, and more. The orange-colored items in the Function Stack are variables.
Let's create a new variable called "hello_world" with some static text:
Now, when you run and debug the API endpoint, the response will display the text you entered.
Dot notation allows you to access and manipulate specific properties within an object or array. It's a powerful tool for extracting and transforming data stored in variables.
Let's say you want to retrieve only the name of the first item in the "content" table. Here's how you can achieve that using dot notation:
When you run and debug the API endpoint, the response will display only the name of the first item in the "content" table.
Filters are another crucial concept in Xano. They allow you to transform the data you have in the Function Stack without executing additional actions. Filters can perform various operations such as text manipulation, math calculations, array conversions, and more.
Let's make the name of the first item in the "content" table uppercase using a filter:
Now, when you run and debug the API endpoint, the response will display the name of the first item in uppercase.
Add-ons enrich the data you're retrieving in your API request with related information. They are particularly useful when working with relational data stored across multiple tables.
Let's say the "content" table has a reference to a "users" table, where each content item is associated with a user. You can use an add-on to include the user information along with the content data:
When you run and debug the API endpoint, the response will include the user information for each content item.
Xano stores all date and time values as Unix timestamps, which represent the number of milliseconds since January 1, 1970, 00:00:00 UTC. However, you can format these timestamps into human-readable formats using filters.
Let's create a new variable called "time_now" to display the current timestamp in a human-readable format:
When you run and debug the API endpoint, the response will display the current timestamp in a human-readable format.
You can also use relative timestamps (e.g., "last week," "2 weeks from now") or specific date formats by adjusting the format string in the "Format Timestamp" filter.
Working with data in Xano involves several key concepts: functions, variables, dot notation, filters, add-ons, and date and time manipulation. By mastering these concepts, you'll be able to build powerful backend services and transform data effectively without writing a single line of code.
Remember, this guide covers just the basics. Xano offers a wealth of advanced features and capabilities that you can explore further in the documentation. Happy building!
This transcript was AI generated to allow users to quickly answer technical questions about Xano.
I found it helpful
I need more support