From data to the portal
An invoice that shows up in your customer's portal was born in your system — an ERP, a database, an API. This page shows the path that data takes to the screen, and where you configure each step.
The path
- Connector — the link to your system: the address, the credentials and the operations it offers (for example, List invoices). Set it up in Connectors.
- Entity — a type of data the portal shows, such as Invoice. The entity says which connector operation brings the records, which fields each record has and which field indicates the holder — whose record it is. It keeps a copy of the records in Magic Dashboard. Set it up in Entities.
- Block — in the Builder, you build pages with blocks: a table of invoices, the detail of an invoice, a list of tax documents to download. Each data block reads the records of an entity. See Data in blocks.
- Published page — the portal shows the version you published. Changes in the draft only appear after you publish. See Publishing and versions.
- Portal user — whoever signs in to the portal sees only the records whose holder equals their tenant ID. See Holder and tenant ID and Portal users.
The portal reads the copy, not your system
When the user opens a page, the blocks read the records the entity has already stored. The portal does not query your system on every visit — even with the When the user accesses sync, it only fetches again when the stored records are past their expiry. That means:
- the portal stays fast even if your system is slow;
- an outage in your system does not take the portal down — it shows the data from the last sync;
- new data only shows up in the portal after the entity's next sync.
When data is updated
Each entity chooses how it syncs with your system:
| Sync | How it works |
|---|---|
| Scheduled | Reads all records from time to time, at the time set in the connector. You can also request a sync right away. |
| Manual | Reads all records only when you ask. |
| When the user accesses | Reads only the records for the tenant ID of whoever is in the portal, when the person signs in and when they open a page with that entity. Records stay valid for a time you choose (from 5 minutes to 24 hours); after that, the next access fetches again, showing the stored records in the meantime. On the first fetch, when nothing is stored yet, the block shows Fetching your data…. |
The details are in Entity sync.
Example
At Aurora Energia:
- The ERP Aurora Energia connector links Magic Dashboard to the ERP's API and syncs every 2 hours.
- The Invoice entity uses the List invoices operation and marks the field Holder CPF/CNPJ as the holder.
- The Invoices page in the Builder has a table of the Invoice entity, with the tabs To pay, Paid and All.
- The page was published.
- A customer signs in to the portal and sees, on the Invoices page, only the invoices for her CPF.
Beyond showing data
The path also works in the opposite direction, in two cases:
- Users from an entity — an entity can create the portal users: each record becomes a user, with the email and tenant ID taken from the fields you choose. See Portal users.
- Buttons and forms — an action or form block can send data out (a webhook or an email). See Forms and actions.