Client Portal View
Configuration reference: Client portal
Overview
The Client portal view shows, in the app, a page made for external clients: an HTML document generated with AI, which reads the data and, with actions, also creates records. Clients open it at the portal's address, without using the app, and each one sees only the rows marked for them and the columns visible to clients.
Use it to give clients a page of their own, for example each one's orders or requests, without opening the rest of the workspace to them. For there to be data to show, the table needs a Contas externas (external accounts) column and columns with Visível no portal (visible in the portal) switched on.
In the app, the view shows a preview with the organization's rows and the portal's address, with the Copiar endereço (copy address) action.
Saved portal
The view points to a portal saved in the workspace, instead of carrying the document inside itself. The same portal can be shown by more than one view, and the list lives in Administration › Portals.
A portal has:
- Nome (name) and Endereço (address): 2 to 48 lowercase letters, numbers and hyphens, unique in the organization.
- Publicado (published): clients only open published portals. It can only be switched on after the document has been generated.
- Audiência (audience): Todos os clientes (all clients) or Só contas escolhidas (only chosen accounts).
- Acesso (access): the external accounts that see the portal, when the audience is Só contas escolhidas.
- Ações (actions): what clients can send from the portal. See Actions.
- Conteúdo (content): the HTML document, generated with Gerar com IA (Alterar com IA once it exists), and the queries it reads.
Choosing the portal
In Configurar (Configure), the Portal card has:
- The Escolhe um portal (choose a portal) selector, with the workspace's active portals.
- Novo portal (new portal): opens the editor and links the portal you create to the view.
- With a portal chosen, the address and document fields disappear and the card shows the summary (address, status and audience) and Editar portal (edit portal), which edits the portal itself.
A view without a portal can only be saved once you choose one.
Who sees the portal
| Audience | Who sees it |
|---|---|
| Todos os clientes | All of the organization's external accounts |
| Só contas escolhidas | Only the accounts selected in Acesso |
A Só contas escolhidas portal with no accounts is visible to nobody. The editor warns: "Sem contas escolhidas: ninguém vê este portal." (no accounts chosen: nobody sees this portal).
At /p, a client with a single portal opens it directly. With several, they see Os seus portais (your portals), grouped by organization, and pick one. Unpublished portals, archived portals and portals outside their audience do not appear.
Actions
An action lets a client send a record from the portal, for example an invoice with a file and a few fields. Each action only creates records in a table: it does not edit or delete existing ones.
In the portal editor, the Ações (Actions) section has one card per action:
- Nome (name): what the document uses to send. Lowercase letters, numbers and
_, starting with a letter, and unique in the portal. - Tabela (table): a table published to clients, with the Contas externas (external accounts) column.
- One row for each Visível no portal (visible in the portal) column that can be filled in: text, number, date, checkbox, select, table link and file. Each one is set to Não (No, not in the action), Opcional (Optional) or Obrigatório (Required). Formulas, rollups and system or read-only columns do not appear.
- On each file column, Tamanho máximo (MB) (maximum size), from 1 to 15, and Tipos aceites (accepted types), for example
application/pdforimage/*. Empty accepts any type. - Confirmação (confirmation): the text the portal shows before sending. Empty sends right away.
If the table requires a column that the action does not ask for, the editor warns and submissions are refused. After changing the actions, generate the document again with Gerar com IA (or Alterar com IA): the AI receives the actions and designs the form. The editor preview saves nothing.
The client fills in the form in the document. With a confirmation, the portal shows the text and the client confirms or cancels. After sending, the document shows the result: the created record or the fields to fix. The values go through the table's rules, and a repeated value in a unique column is refused.
Limits:
- 10 actions per portal.
- 5 files per submission, across all columns.
- 15 MB per file, or the lower limit set on the action.
- 60 submissions per hour for each client.
The record is created in the chosen table with the origin Portal, by the organization's Sistema (System) user, and is marked for the client who sent it: only that client sees it in the portal, the next time the portal loads its data. For the app it is a record like any other. To run an automation only for these records, use the Origem (Origin) filter of the Registo (Mudança) trigger.
For page authors
The document always receives window.OUTDO. Without actions, window.OUTDO.actions is []: to know whether there are actions, test window.OUTDO.actions.length, not window.OUTDO.
-
window.OUTDO.file(ref)andwindow.OUTDO.download(ref): show an image or download a file of a file column, by therefeach file carries in the data. See the portal developer manual. -
window.OUTDO.actions: the list of actions, to draw the form. Each one hasname,confirm,fields(name,label,component,required,config) andfiles(name,label,required,max_bytes,mime_types,multiple). For selects and links,config.optionsholds the options{id, label}. -
window.OUTDO.submit(name, {fields, files}): sends the actionname.fieldsis{column: value}, where the key is the fieldnameinwindow.OUTDO.actions, with dates asYYYY-MM-DD, checkboxes astrueorfalse, numbers as numbers, and selects or links by the optionid.filesis{column: [File]}, with files from an<input type="file">.
The promise never rejects and resolves with:
{ok: true, rowId, label}: the record was created.labelis its title, ornull.{ok: false, error, message, errors}: the submission failed.errorisinvalid,duplicate,too_large,refused,rate_limited,not_found,busy,cancelled,sessionorunavailable.messageis a text ready for the client (absent oncancelled, when they cancel the confirmation) anderrorslists the fields to fix oninvalid.
Always send from a <button type="button">: the document cannot submit forms or use confirm(), and the confirmation belongs to the portal. Only one submission runs at a time.
// With <input id="nota">, <input id="fatura" type="file">, <button type="button" id="enviar"> and <p id="estado">
document.getElementById('enviar').onclick = async () => {
const ficheiro = document.getElementById('fatura').files[0];
const r = await window.OUTDO.submit('nova_fatura', {
fields: { Nota: document.getElementById('nota').value },
files: ficheiro ? { Fatura: [ficheiro] } : {},
});
document.getElementById('estado').textContent = r.ok ? 'Enviado: ' + (r.label ?? r.rowId) : r.message;
};
Older views
Portal views that still hold the document inside themselves keep working as before. In Configurar, the card warns: "Esta vista ainda guarda o portal dentro dela. Ao guardar, passa a portal guardado, visível para todos os clientes." (this view still holds the portal inside itself; on saving, it becomes a saved portal, visible to all clients).
The first time you click Guardar (save), the document moves to a saved portal with the Todos os clientes audience and the same address, and the view points to it. Clients keep seeing it. To restrict it, edit the portal and choose Só contas escolhidas.
Archived portal
If the linked portal is archived, clients stop seeing it and the view shows "O portal ligado já não existe." (the linked portal no longer exists) with the Configurar action, so you can pick another. Restoring the portal in Administration › Portals shows it again.
Tips
- To change the document, edit the portal: the change applies to every view that shows it and to the clients.
- If the editor warns that the document has row values written by hand, ask the AI to read them from
window.OUTDO_DATA; otherwise every client sees those values. - An unpublished portal does not open for clients, even with accounts chosen.