Block Quick Reference

The blocks you reach for daily, grouped by what they do. Build pages with the web blocks, APIs with the register and reply blocks, and data with the storage, mutation and query blocks.

Web pages: render, then update what changed

Web pages are how you build a page or a website. A page answers finished HTML; a button or form runs an action that answers only the parts that changed.

BlockDoes what
web_pageStarts a page flow on a URL. Out-pins: connection, params, query, language.
web_renderRenders the template on the server and answers the finished HTML, with title, description, canonical, Open Graph, hreflang and JSON-LD in the head.
web_foreachRepeats a row template for every item of a list. Every row gets a data-key.
web_templateRenders a template to a piece of HTML: a section, or the new version of one row.
web_actionRuns when a button or form with data-action="name" calls it. Out-pins: form, key and the page's connection, params, query, language.
web_replaceReplaces one element of the page with new HTML.
web_removeRemoves one element, such as the row of a deleted document.
web_insertAdds HTML: append, prepend, before or after.
web_updateGives one element new contents and keeps the element: a counter, a total.
web_errorsShows validation messages next to the fields of the form that sent the action.
web_redirectSends the visitor to another page.

APIs and HTTP: register a route, reply with JSON

BlockDoes what
on_startup_register_uri_getRegisters GET /api/v1/<uri>.
on_startup_register_uri_postRegisters POST /api/v1/<uri> (webhooks, creates).
httpconnection_current_requestThe live request connection object.
httpconnection_get_paramsReads the :name parameters of the request's URI.
httpconnection_get_queryReads the query string of the current request.
httpconnection_set_jsonReplies to the caller with JSON and a status code.
function_trigger_webhook_http_get_json, function_trigger_webhook_http_postCall external APIs. The webhooks group has one per method.

Storage and queries: read, write and search documents

BlockDoes what
storageSelects the storage collection for connected blocks.
function_searchSearches documents (query, limit, offset, cache key).
function_search_single_resultSearches and returns the first hit only.
function_get_documentReads one document by guid.
function_create_document_from_mutationsCreates a document from a mutation set.
function_update_document_mutationsApplies mutations to an existing document.
function_remove_document, function_delete_documentSoft-deletes (recoverable), hard-deletes (permanent).
mutations_set_bp_field_multipleSets several document fields at once.
mutations_set_custom_fieldSets one field with a custom value.
mutations_increment_by_fieldAtomically increments or decrements a number.
query_and, query_bool_mustCombines query parts (AND, multi-term OR).
query_bool_term_fieldsExact match on one field.
query_bool_filterAttaches filter clauses.
query_bool_simple_query_string_fieldFree-text match on a field.
query_bool_range_fieldDate or number range on a field.
query_sort_fieldSorts results by a field.

Data and logic: values, objects and branches

BlockDoes what
value_default, number_defaultA fixed text or number value.
object_new_fieldsBuilds an object with named fields.
object_update_fieldsAdds or changes fields on an existing object.
array_mapTransforms every item in an array.
branchSplits flow into true and false paths on a condition.
condition_not_empty_valueTrue when the checked value is filled.
function_console_logWrites to the blueprint console.
trigger_custom_functionDefines a reusable function.
function_custom_executeCalls a function and waits for it.
function_returnReturns values from a function.

Background and scheduling: work outside the request

BlockDoes what
function_custom_execute_from_queueDefers work to the queue (heavy jobs, retries).
schedule_repeating_eventFires a flow on a schedule.
storage_eventFires on document create, update, save or remove.
function_redis_cache_delete_keyDeletes a Redis cache key (invalidation).
user_currentThe calling user's document.

Integrations: ready-made blocks for outside services

Before calling a service over HTTP, check the integrations: most have their own block group, with the credentials held by a service provider.

State pages and UI components: deprecated

Build new pages with web blocks These blocks still run, so existing pages keep working. New pages use the web blocks above; the migration guide maps one to the other.
BlockDoes what
state_pageRegisters a page URL and starts the page flow.
state_render_pageSends the assembled HTML to the browser.
state_h1 and other text elementsHeadings, text, containers on the page.
state_formForm container element.
state_input_dynamicTyped input field inside a form.
state_buttonButton with a click event.
state_form_getReads the submitted form (form-object, form-error).
state_advanced_datatablePre-styled table fed from a storage.

Next steps

All Blocks The full block library by group. Block Templates These blocks wired into working combinations. Finding Blocks Search techniques and starter sets.

Frequently asked

What are the most-used blocks in RUAL?

This page lists the blocks you reach for daily, web pages first, grouped by what they do. Each entry links to the block's full documentation, and you can search for any block with ⌘K.

Which RUAL block registers a GET endpoint?

on_startup_register_uri_get registers GET /api/v1/<uri>. The POST variant on_startup_register_uri_post is used for webhooks and creates, and httpconnection_set_json replies to the caller with JSON plus a status code.

What is the difference between function_remove_document and function_delete_document in RUAL?

function_remove_document soft-deletes a document, which stays recoverable, while function_delete_document hard-deletes it.