Database Management
Softyflow provides two main approaches for data management: SQL databases via External Data Sources (EDS) and MongoDB Collections. This guide covers both approaches with practical usage examples, as well as Softy Tables, the relational tables stored by Softyflow (section 3.4).
Before diving into database integration, ensure you've completed your project setup and understand how to use databases in your web interfaces and processes.
1. OverviewDirect link to 1. Overview
1.1. SQL via EDS (External Data Sources)Direct link to 1.1. SQL via EDS (External Data Sources)
Softyflow's External Data Sources (EDS) feature allows you to connect your applications to existing enterprise databases. It supports a wide range of SQL databases, including MySQL, PostgreSQL, Oracle, SQL Server, and Snowflake, as well as external APIs. This enables seamless integration with your company's existing data infrastructure, making it a powerful tool for enterprise-level applications. For a deeper dive, you can explore the EDS integration documentation.
The External data sources page (open External databases from the dock) serves as your central hub for managing all external data connections. It offers a consolidated view of every configured data source, from traditional SQL databases to modern APIs, streamlining data management across your projects.

The EDS management page showing a list of configured databases and APIs.
From this interface, you can perform several key actions:
- View all Data Sources: The list displays the name and ID, the Connector (e.g.,
PostgreSQL,MySQL,API REST) and the last update of each configured EDS. Use Search sources… to find one. - Create a New EDS: The Create EDS button opens the page of a new source.
- Manage Existing EDS: Each row has three actions: Open in a new tab, Copy ID and Delete (after a confirmation: the tables, lists and actions that use the source will no longer receive data). Click the row to open its page, where you configure and test it (see EDS).
The screenshot above illustrates a variety of configured data sources, from SQL databases to web APIs. This highlights Softyflow's flexibility, allowing you to build applications that consolidate data from diverse systems, such as internal databases and third-party web services.
1.2. MongoDB CollectionsDirect link to 1.2. MongoDB Collections
For projects that require flexibility and speed, Softyflow includes a built-in MongoDB database. This NoSQL option is ideal for rapid prototyping, storing application-specific data, and managing data with evolving or semi-structured schemas. It allows you to get started quickly without the overhead of setting up an external database.
The Collections page (open Collections from the dock) is your command center for managing these MongoDB collections. It provides a user-friendly interface to oversee, create, and manage all your project's NoSQL data.

The Collections page showing a list of internal MongoDB databases.
From this centralized page, you can perform several essential actions:
- View Collections: The list displays all available collections, showing their Name (and ID), the Project they belong to and their last update. Each row has Copy ID and Delete actions and an arrow that opens the collection page (a click on the row opens it too). Deleting a collection deletes all its data, in Test, UAT and Prod, after a confirmation: the pages and processes that read it will have no data.
- Create a New Collection: The Create Collection button in the top-right corner allows you to add a new collection for storing your application's data. Inside a project, you can also create one from the Collections panel of the project dock.
- Search and Filter: The Search collections… bar provides a quick way to find a specific collection by its name, which is especially useful in projects with many collections.
- Navigate: If you have a large number of collections, the pagination controls at the bottom of the list make it easy to browse through them.
2. SQL via EDSDirect link to 2. SQL via EDS
2.1. Quick SetupDirect link to 2.1. Quick Setup
Connecting to an external SQL database is straightforward. Click Create EDS: the page of the new source lets you define all the necessary parameters for Softyflow to establish a connection. The example below shows the configuration for a MySQL database.

Configuring connection details for a new MySQL data source.
As illustrated in the image, a new data source is being set up. A key feature of Softyflow is the ability to define distinct connection settings for different environments (TEST, UAT, PROD). Here, the details for the TEST environment, such as the host and the database, are being entered. This practice is crucial for a safe development lifecycle, as it isolates development and testing activities from the live production data.
Key configuration fields include:
- Name and EDS Type: Assign a descriptive Name to your connection for easy identification. Select the appropriate EDS Type among the tiles (e.g.,
MySQL,PostgreSQL,Oracle). - Environments (TEST, UAT, PROD): Softyflow's environment-specific configuration allows you to manage database connections for each stage of your application's lifecycle. This ensures that you are always connecting to the appropriate database—a test database during development, a staging database for user acceptance testing, and your production database for the live application.
- Connection Details: These are the standard parameters required to connect to a database, including the
host(server address),user,password, anddatabasename. - Test connection and Tests tab: check the connection of each environment, then use the Tests tab to run SQL reads in the SQL console, discover the tables and columns (SQL tables and structure) and read the results in the response panel. See Testing an EDS.
2.2. Common Use CasesDirect link to 2.2. Common Use Cases
SQL databases are the backbone of many enterprise systems, and using EDS to connect to them opens up a wide range of possibilities:
- Enterprise Integration: Seamlessly connect your Softyflow applications to existing enterprise systems like Customer Relationship Management (CRM), Enterprise Resource Planning (ERP), or other legacy platforms. This allows you to build modern interfaces and processes that leverage your existing data. For more, see our integration features.
- Data Warehousing and Analytics: Access and process large volumes of data from analytical platforms like Snowflake or Google BigQuery. This enables you to build sophisticated, data-driven reports and dashboards directly within Softyflow.
- Cross-System Data Synchronization: Create workflows that synchronize data between multiple business systems. For example, you can build a process that updates your CRM whenever a new entry is made in a separate billing system, ensuring data consistency across the enterprise.
3. MongoDB CollectionsDirect link to 3. MongoDB Collections
3.1. Quick SetupDirect link to 3.1. Quick Setup
Creating and managing a MongoDB collection in Softyflow is designed to be fast and intuitive. Collections can be created directly from the Softyflow IDE, and their schema-less nature provides the flexibility needed for modern application development.
Once a collection is created, its page (/ide/collection/<id>) becomes the central hub for controlling its data, environments and security. It has the same layout as the other editors: a palette of tiles on the left (Data: Overview and Documents; Settings: Rights and Usages), with a summary of the number of documents per environment, and the selected view in the middle.

The Overview of a collection: one card per environment.
This page offers a comprehensive set of tools:
- Overview (Environments): one card per environment (TEST, UAT, PROD) with the number of Documents and the Size, and the actions Open as JSON, Download, Import, Migrate and Clear. Import takes a JSON file (an array of documents, like the file of Download) and asks what to do with documents that already have the same
_id: Copy with a new _id, Overwrite, Skip or Always a new _id. Migrate copies the documents from one environment to another (e.g., from TEST to UAT). Clear permanently deletes the documents of an environment, after a confirmation. - Documents: the documents of the selected environment (TEST, UAT or PROD), page by page, shown as a table; click a row to see the whole document and copy its JSON. Raw JSON opens the documents as raw JSON in a new tab.
- Rights: security is managed at the collection level. Each role gets its Create, Read, Update and Delete rights on the data of the collection, in every environment (Add a role). With no role, nobody can use the data of the collection. Save the rights with Ctrl + S.
- Usages: click Search to find the interfaces, processes and APIs of every project that use the collection, in the TEST or PROD version of the resources.

3.2. Common Use CasesDirect link to 3.2. Common Use Cases
The flexibility of MongoDB collections makes them suitable for a wide variety of applications:
- Rapid Prototyping and Development: When you need to get an application up and running quickly, collections offer a fast data storage solution without the need for a formal database setup or schema design.
- Application Settings and User Preferences: Collections are perfect for storing configuration data, user-specific settings, and personalization information, as the structure can easily adapt to new options.
- Temporary and Session Data: They are an excellent choice for storing transient data such as user session information, logs, or the results of temporary calculations.
- Flexible or Evolving Data Schemas: If your data structure is likely to change over time or if different documents need to have different fields, the schema-less nature of MongoDB is a significant advantage.
3.3. Custom ListsDirect link to 3.3. Custom Lists
A custom list is a short list of values (label, value and colour), for example statuses, priorities or categories, used by dropdowns, radio buttons, tables and the call schema of APIs. Create one from the Lists panel of the project dock; its editor (/ide/custom-list/<id>) has four tiles:
- Values: one row per value with its Label, Value, Colour and a Preview of the badge. Add values with Add a value, drag rows to change the order, and filter them. Import replaces the values with those of a CSV file (label, value, light colour, dark colour, then the translated labels) or a JSON file (a list of objects such as
{ "label": "France", "value": "france" }, see The List Editor), Export CSV and Export JSON download them, and Raw JSON opens the TEST list as the applications load it. Duplicate values and rows without label or value are flagged. - Translations: the label of each value in the other languages (16 languages); a language left empty shows the original label.
- General: the name and the identifier of the list.
- Rights: who can load the list in the applications: Any signed-in user, Also without signing in, or The members of the role you choose.
Save with Ctrl + S; the Version history of the rail lets you load a previous version. See Custom Lists for their use in widgets.

3.4. Softy TablesDirect link to 3.4. Softy Tables
A Softy Table is a relational table stored in the PostgreSQL database of Softyflow. Unlike a collection, each column has a type: String, Long Text, Integer, Number, Date, Time, Date & Time, Email, Boolean, Single Select, Multi Select, File, JSON, Array, User, Lookup (a field read from a related table), Total and Formula (computed fields), Created By and Updated By. Relation columns link the tables: One-to-Many (a parent and its children; the child table gets the many-to-one column back to its parent automatically) and Many-to-Many. Pages read and write the rows with the SoftyTable source of the table widget and the SoftyTables actions; scripts use the Softy Table methods of the process SDK and the web modeler SDK.
3.4.1. The Page of a Softy TableDirect link to 3.4.1. The Page of a Softy Table
To create a table, click Softy Tables in the project dock, the Softy Table tile of the Build home, or the + of its card, then give it a name. The name is unique in the whole workspace; spaces become _. The table opens in a tab of the editors.
The page of a table has a palette on the left and the current view in the frame:
- Rows shows the rows in a grid. Search the text columns, click a header to sort, and switch between Test, UAT and Prod. Add New opens a form: nothing is created before you confirm it. Click a row to edit it in a drawer, which only sends the fields you changed and loads the many-to-many links of the row before you can change them; Delete is at the bottom of the drawer. Tick rows to delete them together. In UAT and Prod, a strip reminds you that you are changing the real data.
- Columns opens the structure of the table: the column types on the left, the columns in the middle, and the settings of the selected column on the right. Nothing changes before Save Schema. The structure is edited in Test; the other environments show theirs read-only.
- Deploy shows an environment card each for Test, UAT and Prod: the rows, the columns, and the differences with Test. Deploy from Test publishes the Test schema and rights to that environment, after a confirmation that lists what changes. An environment where the table was never deployed says so in the grid, with the same button.
- Rights gives each role its Create, Read, Update and Delete rights. They apply to Test and reach UAT and Prod with the next deployment.
- Interfaces generates the list and the form of the table (see below).

3.4.2. Generating the List and Form Screens (Create UI)Direct link to 3.4.2. Generating the List and Form Screens (Create UI)
Generate the interfaces, in the Interfaces view of the table page, generates two interfaces in the project of the table: Liste <table>, a list of the rows, and <table> Fiche, the form of a row. The UIs Created Successfully box offers Open List UI and Open Form UI to open them in the UI builder. It also shows warnings when a related table has no Form UI yet (generate the child table first, then run Create UI again on the parent so that the grid of the children can open their rows) or when a related table no longer exists (the relation is left out of the screens).

Run Create UI again after changing the columns: the two screens are generated again (UIs Regenerated Successfully).
- Each generation creates a new version of the screens; the previous version stays in their version history, so you can load it again.
- If a screen was changed in the UI builder since it was generated, Softyflow asks for a confirmation first: Yes replaces it with a new generated version, No changes nothing.
- For screens generated before 8.6, the first Create UI always asks this confirmation ("… generated before the version tracking, any change made in the builder will be replaced …"): Softyflow cannot tell whether they were changed in the builder.
- The settings of the pages are kept: access rights, home page, menu, languages, favicon. A generated screen that was deleted is created again.
The generated screens contain:
- List: a title, an Ajouter button that opens the form for a new row, and a table with one typed column per field (dates as DD/MM/YYYY, date-times in the local time, readable JSON, authors, lookups, the number of linked rows for one-to-many and many-to-many relations, the parent shown by its label), with filters (a period filter for dates), sorting and export, and Modifier and Supprimer buttons on each row.
- Form: the fields of the row without the ID field (the database gives it), the authors and dates of creation and update, a selector for the parent of a many-to-one relation, a multiple selection for the many-to-many links, and a grid per child table with Ajouter, Modifier and Supprimer (the buttons that open a child row appear when the child table has its own screens).


The screens already generated change only after a new Create UI (a new version, then the usual deployment).
3.4.3. Behaviour Changes in 8.6Direct link to 3.4.3. Behaviour Changes in 8.6
updateManyanddeleteManyrefuse an empty criteria ("A criteria is required… use clear to delete all rows"): to update every row on purpose, give an explicit criteria such as{ id: { $gt: 0 } }; to empty a table, useclear.retrievealso returns, for each many-to-many column, the list of the linked IDs, so a page that loads a row and saves it again keeps its links.- Outside Test, a value for a column that is not yet published in that environment is refused ("this column is not published in uat, publish the table in uat to save its value"); publish the schema with Deploy Test Config first.
- Names that the database would cut are refused: a new table whose name, followed by
_sf_prod, would exceed 63 bytes, a table name that ends with_sf_test,_sf_uator_sf_prod, and a new column whose name (or a name derived from it, for options or many-to-many links) exceeds 63 bytes. Existing tables stay editable. - A schema change that fails in the SQL database is cancelled: the previous schema stays in place and the IDE shows the error.
- Database errors are readable: a value already used by another row, a linked row that does not exist, a row still referenced by rows of another table ("delete or detach them first").
3.4.4. Computed FieldsDirect link to 3.4.4. Computed Fields
A computed field is a column whose value the database works out and keeps up to date. Nobody types it: a value sent by a form, an API or a direct SQL statement is ignored. It is a real column: it can be shown, sorted and filtered like any other, read by a Lookup and used in an SQL statement with @table(...).
In the Columns view, the Computed group of the palette holds two types:
- Total: a calculation on the rows of a child table. Choose the Child table (the tables with a relation to this one), the Calculation (Sum, Number of rows, Maximum, Minimum or Average) and the Column read. Only some rows keeps the rows whose Single Select column has the chosen values, for example the invoices with the status Paid.
- Formula: a calculation between the numeric columns of the same row, computed fields included, with numbers,
+ - * /and parentheses:initial_amount + amendments. A division by zero gives an empty value.
A total can read a computed field of its child table. For example, a project adds up amount_done of its contracts, and each contract adds up its invoices: writing an invoice updates the contract, then the project.
- When the values change: at each write on a child row, whatever writes it (page, action, API, script, SQL, import). A whole import is one recalculation. Saving a computed field fills the rows that already exist.
- Deployment: a computed field is deployed with its table. If its child table is not deployed in that environment yet, the deployment says so and the field stays empty until the child table is deployed.
- Protected columns: a change that would break a computed field is refused and names it: removing or changing the type of a column it reads, removing the relation, deleting the child table. Change the computed field first.
- Recalculate: the configuration of a saved computed field offers Recalculate for each environment. It reads every row again. It is a repair: the values are normally always up to date.
- Not offered: a total through a Many-to-Many relation, formulas on dates or text. For these cases, write an SQL statement with
@table(...).
4. Usage in WidgetsDirect link to 4. Usage in Widgets
One of the most powerful features of Softyflow is the ability to integrate your databases directly with web interface widgets. This allows you to build dynamic, data-driven user interfaces with ease.
In the UI builder, you connect widgets like dropdowns and tables to your data sources in their configuration panel. The image below shows a dropdown whose options come from an external database.

In this example, the Data Source card of the panel on the right shows that the widget's Data Source is EDS and that the Database is SQL Test. The options of the dropdown are loaded from that database when the page runs; in the builder, the widget only says where its data will come from.
4.1. Dropdown/Select WidgetsDirect link to 4.1. Dropdown/Select Widgets
Select widgets are commonly used to present users with a list of choices. Populating these choices from a database is a frequent requirement.
4.1.1. SQL via EDSDirect link to 4.1.1. SQL via EDS
When using an SQL database, you can configure the Select widget to fetch data using a query.

The configuration involves a few key steps:
- Data Source: Set this to
EDS. - Database: Choose the EDS connection, such as
SQL Test; the eye icon opens the source. - Options (Label and Value): Specify which columns of the result serve as the display text (Label) and the stored value (Value) of each option, for example
nameandid. - EDS Source: The Edit button opens the Data query popup, where you write the SQL query as a JavaScript string. The popup shows the type of query expected, with an example.
You can also write dynamic queries that change based on other data in your application.

The query shown above, "SELECT id, name FROM products WHERE category = '" + {{categorie_type}} + "'", is a powerful example of dynamic filtering. The {{categorie_type}} syntax embeds the value of a variable of the page directly into the SQL query. When the user changes the field bound to categorie_type, this dropdown refreshes to show the matching options. This is a key technique for building interactive and responsive forms.
4.1.2. MongoDB CollectionsDirect link to 4.1.2. MongoDB Collections
Connecting a Select widget to a MongoDB collection is just as easy.

The configuration options are tailored for MongoDB:
- Data Source: Set to
Collection. - Collection: Select the MongoDB collection (e.g.,
demo_collection). - Options (Label and Value): Map them to the fields of your documents. For example, Label could be
category_nameand Value the document's_id. - Query, Sort By and Limit: Edit opens the Data query popup to filter the documents; Sort By orders the options (e.g., by
createdAtin descending order:-1) and Limit sets the maximum number of options.
For more complex scenarios, turn on Aggregation in the Data query popup: the query becomes a MongoDB aggregation pipeline that transforms the data before it is displayed.

The pipeline shown above performs three stages:
$match: Filters the documents, selecting only those where thesociete_idmatches the dynamic value of{{societe_label}}.$project: Reshapes the documents to create alabelandvaluefield, which are required by the Select widget. This is useful for adapting your existing data structure to the widget's needs.$sort: Orders the final results by thelabelfield.
A pipeline sent from a page may only read data: see the note of section 5.2.1.
4.2. Table WidgetsDirect link to 4.2. Table Widgets
Table widgets are ideal for displaying a large amount of data in a structured format. Their Data source card starts with the question Where do the rows come from? and six tiles:
- Collection: the documents of a collection of the project, filtered by the query.
- Report: the instances of a report, with its measures.
- EDS: an external database (SQL, LDAP, Google Sheets, API) declared in EDS.
- Variable: the content of the table's variable, filled by the page.
- Users: the users of the workspace.
- SoftyTable: the rows of a Softy Table.
Then choose the resource (Choose a collection, Choose a connection…; the arrow next to it opens the resource), write the query with Edit the query (when there is no query yet: Write the query for an EDS, Add a filter for the other sources), and set the other options of the card:
- Default sort: Sort by a field, Descending or Ascending; except for an EDS, Advanced sort (several fields) opens an editor for a
$sortobject. - Rows per page: the number of rows of each page of the table.
- Row click: the action run when the user clicks a row.
- User views: each user moves and resizes the columns, filters, sorts, and saves that as named views (see Table widget).
4.2.1. SQL via EDSDirect link to 4.2.1. SQL via EDS
Connecting a Table widget to an SQL database is similar to connecting a Select widget: choose the EDS tile, the EDS connection, then write the EDS query, an SQL query written as a JavaScript string. With no query, the source is read as is.

4.2.2. MongoDB CollectionsDirect link to 4.2.2. MongoDB Collections
Similarly, you can populate a Table widget from a MongoDB collection.

The key configuration fields for a collection-based table include:
- Data source: Choose the Collection tile.
- Collection: Specify the collection you want to display.
- Query: Add a filter (Edit the query once there is a filter) opens the Data query popup, to filter the data shown in the table (e.g., show only the records with an
activestatus). With no filter, every document is shown. - Default sort: In the example,
createdAtand Descending show the newest documents first. - Rows per page: The number of records per page, enabling pagination.
4.2.3. The Data Query PopupDirect link to 4.2.3. The Data Query Popup
Edit the query (or Write the query / Add a filter when there is no query yet) opens the Data query popup. Its header recalls the source, the resource and the widget; a help box describes the query expected by this type of source, with an example. Below the editor:
- Aggregation (collections and reports): the query is a pipeline,
[{ $match: … }, { $group: … }], instead of a filter. - SQL statement (SoftyTable): the query is an SQL statement on the table instead of a filter. Name a table with
@table(<table>): the server replaces it with the table of the environment of the page, TEST, UAT or PROD (details). - Test the query: the variables found in the query are added to the Trial values (JSON) automatically; give them a value and click Run the test to see the first rows in Results, in the columns of the table or with all their data. The test is read only: nothing is changed. When the query fails, the message of the server takes the place of the rows.
Save keeps the query in the widget, Cancel closes the popup without changing it. The popups of section 4.3 below show this test.
4.3. Advanced FilteringDirect link to 4.3. Advanced Filtering
4.3.1. Dynamic Filters (SQL)Direct link to 4.3.1. Dynamic Filters (SQL)
For more advanced security and personalization, you can build SQL queries that dynamically change based on the user's role or other context.

The JavaScript code in the editor constructs a dynamic SQL query:
- It starts with a base
SELECTstatement filtered by theaudit_typevariable. - It then uses a ternary operator (
? :) to check if the current user's roles (SF_connectedUser.roles) include a specific role ID. - If the user has the required role, an additional condition (
AND region = '…', with thecode_regionvariable) is appended to the query, restricting the data they can see. - If not, the query stays as it is.
This is a powerful technique for implementing data security and creating context-aware applications where users only see the data relevant to them. Check it with Test the query before saving.
4.3.2. MongoDB Query FiltersDirect link to 4.3.2. MongoDB Query Filters
The same dynamic filtering can be achieved with MongoDB queries. The query editor allows you to use {{variable}} syntax to build filters that respond to user input or application state.

5. Usage in ActionsDirect link to 5. Usage in Actions
Beyond populating widgets, databases are central to performing operations within your application. Softyflow's web interface actions and process designer allow you to create powerful, automated workflows for handling data.
The database actions are in the Collection category of the Actions drawer: the actions of the collections (addToCollection, getCollection, AggregateCollection…) and those of the EDS, whose name ends with (EDS) (insertTable (EDS), findMany (EDS)…). The actions of the Softy Tables have their own SoftyTables category. Open a category, or type a name in Add an action: the list shows each action as Name : description, for example InsertTable (EDS) : Insert object in the external data source. Once added, an action shows its icon and its fields; hover the icon to see its name. Every action is described in Actions.
5.1. Form SubmissionDirect link to 5.1. Form Submission
A primary use case for actions is handling form submissions, where user-entered data is saved to a database.
5.1.1. SQL via EDSDirect link to 5.1.1. SQL via EDS
The insertTable (EDS) action saves form data in a table of an SQL database.

When a user submits a form, you can trigger a workflow that:
- Validates the data: the validateForm action checks the rules of the fields of the Main Form.
- Runs insertTable (EDS): choose the EDS (here
SQL Test) and the Table ("customers"). With Attach form set to a form, such as Main Form, the data of the form is inserted; with Manual insert, the Statement editor maps the variables of the page to the columns, for example{ name: {{customer_name}}, email: {{customer_email}} }. The result is stored in the variable named in Dump var ("insertResult"). - Provides Feedback: an alertMessage action shows a confirmation message (or a redirect action opens another page).
5.1.2. MongoDB CollectionsDirect link to 5.1.2. MongoDB Collections
Similarly, the addToCollection action saves form data as a new document of a MongoDB collection.

The configuration for this action is straightforward:
- Select the Collection: Choose the target collection, such as
demo_collection. - Map the Data: With Attach form set to a form, such as Main Form, the data model of the form becomes the new document; Manual insert lets you write the document in the Data model editor. The ID of the new document is stored in the variable named in Dump var (
"insertedId"). - Define Subsequent Actions: After saving, you can add further actions, such as refreshWidget on a table widget to show the newly added data, providing a seamless experience for the user.
5.2. Data Loading and ProcessingDirect link to 5.2. Data Loading and Processing
5.2.1. MongoDB AggregationDirect link to 5.2.1. MongoDB Aggregation
For more complex data retrieval needs, Softyflow provides the AggregateCollection action (Mongo Aggregation Query). It runs a full MongoDB aggregation pipeline, written in its Aggregation editor, on a collection.

This action is incredibly versatile and can be used for:
- Performing calculations across multiple documents.
- Grouping data to generate summaries or reports.
- Filtering and reshaping data before it is displayed in a widget or passed to another action.
The result of the aggregation is stored in the variable named in Dump var (here "statsByCategory"), for later use.
Pipelines sent from a page are checked. Since 8.6, the aggregation pipelines and the criteria sent from a page (the data source of a table or a dropdown, the AggregateCollection action, the page SDK) are checked by the server before they reach MongoDB:
- Only read stages are accepted.
$out,$merge,$function,$accumulatorand$whereare refused at any depth (sub-pipelines and expressions included), as is any unknown stage: the request fails with a400error "Aggregation refused: …". $lookup,$graphLookupand$unionWithmay only read the collection itself, or another Softyflow collection (<name>_<mode>) that the user is allowed to read in that environment. Theuserscollection is never accessible.- The criteria of the list, count and update-many requests refuse
$whereand$functiontoo. - In the process scripts (server SDK), the
SF.collectionmethods are not concerned: they read the database directly.SF.report.aggregategoes through the server like a page, so its pipeline is checked.
The pipelines and filters of the existing pages, reports and actions use none of the refused stages and keep working.
5.3. Update OperationsDirect link to 5.3. Update Operations
Updating existing data is another fundamental database operation handled through actions.
5.3.1. Update in SQLDirect link to 5.3.1. Update in SQL
The updateTables (EDS) action is the equivalent of a SQL UPDATE statement. It's used to modify one or more existing records in your SQL database.

You typically use this action after a user edits a form. Its Find Table editor selects the record(s) to update (the WHERE clause, for example { id: {{customer_id}} }). With Manual insert, the Updated Table editor maps the new values of your form variables to the table columns; with a form in Attach form, the data of the form is used. An update without selection is refused (see 8.3).
5.3.2. MongoDB UpdateDirect link to 5.3.2. MongoDB Update
For MongoDB, the updateCollection action allows you to modify a single document.

To use this action, you provide the Document id of the document you want to update (here {{document_id}}) and the new data: the data model of the form chosen in Attach form, or a Data model that you write with Manual insert. This is essential for saving changes to an existing record that a user has modified in an edit form.
6. Populating Forms with Database DataDirect link to 6. Populating Forms with Database Data
A common requirement for forms is to pre-fill them with existing data from a database, especially for editing records. Softyflow provides dedicated actions for this purpose.
6.1. Populating from SQL via EDSDirect link to 6.1. Populating from SQL via EDS
The findMany (EDS) action is a versatile tool for retrieving multiple records from an SQL database based on the criteria of its Find editor.

While this action is perfect for populating tables, it can also be used to find a specific record (or set of records) to populate a form. For example, the action above finds all the contact persons associated with a particular client ({ client_id: {{client_id}} }) and stores them in the contacts variable (Dump var), which you can then display in a list or use to fill your form fields. To read a single record, use findOne (EDS).
6.2. Populating from a MongoDB CollectionDirect link to 6.2. Populating from a MongoDB Collection
The getDocument action is specifically designed to retrieve a single document from a MongoDB collection by its ID and populate a form with its data.

This action is fundamental for building "edit" forms. The typical workflow is:
- A user selects an item from a list or table.
- The ID of the selected item is passed to the Document id of the getDocument action.
- The action fetches the complete document from the MongoDB collection.
- With Attach form set to a form (here Main Form), the fields of the document fill the matching fields of the form, ready for the user to edit; with Manual insert, the document goes to the variable named in Dump var.
7. Best PracticesDirect link to 7. Best Practices
Choosing the right database technology is critical for the success of your project. Here are some guidelines to help you decide between SQL EDS and MongoDB Collections.
7.1. When to Use SQL via EDSDirect link to 7.1. When to Use SQL via EDS
SQL databases are the right choice when your project involves structured data and requires robust, enterprise-grade features.
✅ Use for:
- Existing Enterprise Systems: Integrating with established systems like ERPs, CRMs, or other legacy databases.
- Complex Reporting and Analytics: When you need to perform complex queries, joins, and aggregations for business intelligence.
- Large, Relational Datasets: For applications that manage large volumes of data with clear, predefined relationships.
- Data Consistency and Integrity: When strict data consistency and ACID compliance are non-negotiable.
- Regulatory Compliance: For projects that must adhere to strict data governance and regulatory standards.
7.2. When to Use MongoDB CollectionsDirect link to 7.2. When to Use MongoDB Collections
MongoDB collections offer speed and flexibility, making them ideal for modern, agile development.
✅ Use for:
- Rapid Application Development: Quickly build and iterate on prototypes and MVPs without being slowed down by schema migrations.
- Flexible, Evolving Data: For applications where the data model is expected to change or where documents have varying structures.
- Application-Specific Data: Storing configurations, user preferences, or other data that is closely tied to the application logic.
- Temporary or Cache Data: Managing session data, logs, or cached content that is transient by nature.
- Content Management: Handling unstructured or semi-structured content like articles, product catalogs, or user-generated content.
8. Security ConsiderationsDirect link to 8. Security Considerations
Database security is paramount. Here are key security practices for both SQL and MongoDB databases in Softyflow.
8.1. SQL SecurityDirect link to 8.1. SQL Security
- Prevent SQL Injection: Always use parameterized queries or prepared statements, especially when incorporating user input into your queries. Softyflow's dynamic query features (
{{variable}}) help mitigate this risk. - Enforce the Principle of Least Privilege: Use role-based access control (RBAC) in your database to ensure that application users can only access the data they are authorized to see.
- Encrypt Sensitive Data: Protect sensitive data both in transit (using SSL/TLS for the connection) and at rest (using database-level encryption).
- Conduct Regular Audits: Regularly review database logs and user permissions to detect and address potential security vulnerabilities.
8.2. MongoDB SecurityDirect link to 8.2. MongoDB Security
- Schema and Input Validation: Even though MongoDB is schema-less, your application should enforce a strict data validation layer to prevent malformed or malicious data from being saved.
- Use Field-Level Permissions: Configure roles that have permission to access only the specific fields they need, rather than the entire document.
- Implement Data Sanitization: Sanitize any user-provided input that is used in queries to prevent NoSQL injection attacks.
- Establish Backup and Recovery Plans: Regularly back up your collections and test your recovery procedures to prevent data loss in the event of an incident.
- Rely on the Server Checks: The pipelines and criteria sent from pages are checked by Softyflow (read stages only, no server-side JavaScript,
$lookuplimited to the collections the user may read): see 8.3.
8.3. What Softyflow EnforcesDirect link to 8.3. What Softyflow Enforces
Since 8.6, Softyflow applies the following rules on the server, for every application, whatever the pages or actions send:
- Collections (MongoDB): the pipelines and criteria sent from pages are checked: no stage that writes (
$out,$merge), no JavaScript run on the database server ($where,$function,$accumulator),$lookuponly on the collections the user may read, and never onusers(see the note of section 5.2.1). In process scripts, theSF.collectionmethods are not concerned, whileSF.report.aggregateis checked. - Upserts: an update with the
upsertoption, and a mass upsert, only create documents when the user has the Create right on the collection. Without it, only the existing documents are updated; an update with theupsertoption that matches nothing is refused, and a mass upsert that holds a row without_idis refused as a whole (403, "creating documents requires the create right"): nothing is written. - SQL EDS: a user who does not have the four rights (Create, Read, Update, Delete) of the source can only send read SQL from a page: a single statement, no comment that hides the rest of the query, no write or administration statement, no function that waits, reads files or reaches other servers. An update or a delete without selection is refused for everyone ("Empty selection"); to touch every row on purpose, use the query
"1=1". See EDS. - Users: the user endpoints never return the password, the password history, the reset tokens or the third-party tokens of a user, even to an IDE user.
- Softy Tables:
updateManyanddeleteManyrefuse an empty criteria, and a value for a column not yet published is refused outside Test (see 3.4.3).
For the server SDK of the process scripts, see the process SDK.
9. Migration Between SystemsDirect link to 9. Migration Between Systems
Softyflow's action-based workflows make it possible to automate data migration between different database systems.
9.1. From MongoDB to SQLDirect link to 9.1. From MongoDB to SQL
You can create a sequence of actions that reads data from a MongoDB collection and writes it to an SQL database. This is useful for moving data from a flexible prototyping environment to a structured production database.
The image below shows the actions of a button that automate this migration:

This sequence consists of three main steps:
- getCollection: retrieves the documents of
demo_collectionthat match its Criteria (here the active ones) into thedatavariable. - setVariable: stores in
exportedDatathe documents transformed to match the SQL schema, here with{{data}}.map(doc => ({ id: doc._id, name: doc.name, email: doc.email })). - insertMany (EDS): inserts the rows of
exportedData(its data editor holds{{exportedData}}) into thecustomerstable of theSQL TestEDS.
This type of automated workflow is a powerful example of how Softyflow can orchestrate complex data operations between disparate systems.
This documentation provides practical examples for both SQL and MongoDB usage in Softyflow applications. Choose the appropriate data storage method based on your specific requirements and existing infrastructure.
Next StepsDirect link to Next Steps
Now that you understand database integration, continue building your application:
- Web Interface Design - Create interfaces that display and interact with your data
- Process Design - Design processes that use your database data
- Integration - Connect with external data sources and APIs
- Reporting - Create reports from your database data
- Test & Deploy - Test your database integrations across environments
- Monitor & Run - Monitor your data-driven processes
For hands-on experience, try our step-by-step tutorials or watch our database video tutorials.
For advanced database features, explore our EDS documentation, MongoDB integration, and learn about using databases in Select widgets and Table widgets.