Function Hub

Function Hub is an API that provides utility functions you can call from your Adalo apps using Custom Actions. It offers math operations, string manipulation, and time calculations.

Obtaining an API Key

Function Hub is presently available as an early beta and has not yet been fully integrated into the Adalo Builder. To generate an API key you can use the command-line tool cURL, passing in your application ID:

$ curl -X POST https://functionhub.adalo.com/api/keys \
-H "Content-Type: application/json" \
-d '{"app_id": "YOUR-APP-ID"}' \
{"api_key":"124TYghFYU9898123PRTNF"}%

Your API key will be returned in a JSON response. In the above example the key is 124TYghFYU9898123PRTNF. Copy that key and save it to your password manager.

Configuring Custom Actions to Use Function Hub

To call any Function Hub endpoint from your Adalo app:

  1. Open your app in the Adalo editor

  2. Select the component or screen that should trigger the action

  3. Add a Custom Action

  4. Set the API Base URL to https://functionhub.adalo.com

  5. Set the Method (POST or GET, depending on the endpoint)

  6. Set the URL path for the specific endpoint (e.g. /api/math/sort)

  7. Under Headers, add:

    • Key: X-API-Key

    • Value: your API key

  8. Under Headers, add (for POST requests with a JSON body):

    • Key: Content-Type

    • Value: application/json

  9. Configure the Body or URL parameters as described for each endpoint

  10. Under the Response, map the output fields (e.g. result) to Magic Text or a property in your app

Supported Endpoints

A limited number of useful endpoints are currently available. We will continue expanding capabilities based on Maker request!

Sort Numbers

Sort a list of comma-separated numbers in ascending order.

Use Cases

  • Sort a list of scores or ratings

  • Order prices from lowest to highest

  • Rank numerical data from a collection

Method

POST

URL

/api/math/sort

Auth

Required

Request Body

Parameter
Type
Required
Description

numbers

string

Yes

Comma-separated integers (e.g. "5,2,9,1,3")

Example

Request:

Response (200):

You can test this endpoint using cURL and your API key:

Configuring a Custom Action to Sort Numbers

  • Method: POST

  • URL: /api/math/sort

  • Body: Set numbers to a comma-separated list β€” you can use Magic Text to pull values from your database

  • Output: Map result to display the sorted list

Replace Text

Replace all occurrences of a substring within a string.

Use Cases

  • Clean up user input (remove unwanted characters)

  • Replace placeholder text with dynamic values

  • Redact sensitive words from displayed content

Method

POST

URL

/api/string/replace/{string}/{search}/{replace?}

Auth

Required

URL Parameters

Parameter
Required
Description

string

Yes

The original text to modify

search

Yes

The substring to find

replace

No

The replacement text. If omitted, the search term is removed.

Examples

Replace a word:

Remove a word (no replacement):

Configuring a Custom Action to Replace String

  • Method: POST

  • URL: Build the path dynamically using Magic Text: /api/string/replace/{YourTextField}/{SearchTerm}/{ReplacementText}

  • Output: Map result to a text property or display field

Text Manipulation

Transform a string using one of several built-in options.

Use Cases

  • Normalize user names to title case (capitalize)

  • Store email addresses as lowercase

  • Display headings in uppercase

Method

POST

URL

/api/string/convert/{function}/{string}

Auth

Required

URL Parameters

Parameter
Required
Description

function

Yes

One of: uppercase, lowercase, capitalize, reverse

string

Yes

The text to transform

Available Functions

Function
Description
Example Input
Example Output

uppercase

Convert all characters to uppercase

hello world

HELLO WORLD

lowercase

Convert all characters to lowercase

Hello World

hello world

capitalize

Capitalize the first letter of each word

hello world

Hello World

reverse

Reverse the string

hello

olleh

Example

Error Response

If the function name is invalid:

Status: 404

Configuring a Custom Action to Manipulate Text

  • Method: POST

  • URL: /api/string/convert/capitalize/{YourTextField} β€” replace capitalize with your desired function

  • Output: Map result to a text property

Concatenate Text

Join comma-separated text segments into a single string separated by spaces.

Use Cases

  • Combine first name, last name, and suffix into a full name

  • Build a full address from street, city, state, and zip fields

  • Merge multiple text fields into a single display string

Method

POST

URL

/api/string/concatenate/{text}

Auth

Required

URL Parameters

Parameter
Required
Description

text

Yes

Comma-separated values to join (e.g. hello,world)

Empty values are automatically filtered out, and each segment is trimmed of whitespace.

Example

Configuring a Custom Action to Concatenate Text

  • Method: POST

  • URL: Build the path with Magic Text: /api/string/concatenate/{FirstName},{LastName},{Suffix}

  • Output: Map result to a text property (e.g. full name)

Time Difference

Calculate the difference between two times.

Use Cases

  • Calculate how long a shift lasted

  • Show the duration between two scheduled events

  • Display time remaining until a deadline

Method

GET

URL

/api/temporal/between/{startTime}/{endTime}/{unit?}

Auth

Required

URL Parameters

Parameter
Required
Description

startTime

Yes

Start time in 24-hour format (HH:MM, e.g. 09:00)

endTime

Yes

End time in 24-hour format (HH:MM, e.g. 17:30)

unit

No

Output unit. Default: minutes. Options: minutes, hours, seconds, hm

Unit Options

Unit
Response Key
Description
Example (09:00 to 10:30)

minutes

minutes

Total minutes

90

hours

hours

Whole hours (rounded down)

1

seconds

seconds

Total seconds

5400

hm

hours_minutes

Hours and minutes as H:MM

"1:30"

Examples

Default (minutes):

Hours and minutes:

Configuring a Custom Action to Calculate Time Difference

  • Method: GET

  • URL: Build the path with Magic Text: /api/temporal/between/{StartTimeField}/{EndTimeField}/hm

  • Output: Map hours_minutes (or minutes, hours, seconds depending on your chosen unit) to a text or number property

Tips & Best Practices

  • URL-encode special characters β€” If your text contains spaces or special characters, they must be URL-encoded in path parameters (e.g. hello%20world for hello world). Adalo handles this automatically when using Magic Text.

  • Use hm for display β€” The hm unit returns a human-readable format like 1:30 that's ideal for showing durations in your app UI.

  • Concatenate for dynamic text β€” Use the concatenate endpoint to build full names, addresses, or any text from multiple Adalo database fields.

  • One key per app β€” Create a single API key per Adalo app. Use the same key across all Custom Actions in that app.

  • Test with the interactive docs β€” Visit /docs/api on the base URL to test endpoints directly in your browser before setting up Custom Actions.

Last updated

Was this helpful?