Action custom_modules__get
System ID:
action_custom_modules__get
Description
Finds one custom module record by filters (from the parameter or from constants) and stores it in a constant. Supports sorting via order (one field and a direction). In the scenario editor the model and fields can be picked from a list.
Events (scenario branches)
| Event | When it occurs |
|---|---|
| success | Record found and saved |
| error | Missing module_name, nothing found, or query failed |
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
module_name |
string | yes | — | Name (alias) of the Custom Data model; model is also accepted |
bot_id |
number | no | current bot | Module bot ID |
filters |
object | no | null |
Search by fields: { "column": "variable_name" }. Finds a record where the column equals the variable's value (name without {{ }}). If the variable is missing, the condition is skipped. Without filters — search by model:column constants |
order |
string | no | null |
One field and an optional direction: "createdAt" or "createdAt,DESC" (ASC/DESC). Columns: id, createdAt, updatedAt and the model's columns |
set_to |
string | no | module name | Constant for saving; also saved_entity |
Configuration example
{
"module_name": "order",
"filters": {
"status": "order_status",
"client_id": "client_ref"
},
"order": "createdAt,DESC",
"set_to": "pending_order"
}
The node finds the latest order whose status equals the value of the variable order_status and whose client_id equals the value of client_ref.
Picking in the editor
When the platform administrator has enabled Custom Data pickers, the node settings offer:
- Model — a searchable list of this bot's Custom Data models. You can also type your own name: if the model is not among those available to your role, a warning appears under the field and the value is kept.
- Search by fields — for each row you pick a model field and write a variable name without
{{ }}as the value. With no fields set, the search usesmodel:fieldconstants. - Sort order — one field from a list and a direction, "Ascending" / "Descending".
Pickers work for the current bot's models. If the node has the bot_id of another bot, the fields stay free text.