Course · Lesson 16 of 20

Save, restore and send Data deliberately

Choose an interchange format and separate local editing from explicit data delivery.

Reading · Practice2 sectionsPrerequisites: Load Data when it is read
Course contents

Decide what leaves the page

The Data exchange example separates local editing from export, typed save/restore and submission. These are explicit actions. A field update is not automatically a database write, and leaving a page does not guarantee that its Data was saved.

JSON is useful for interchange with other services. Typed TYTX save/restore preserves the richer value model. Choose the representation according to what the receiver understands, rather than treating the two as interchangeable.

Define the receiving workflow

A form can send a structured request to a service that generates a document. The receiver owns authentication, authoritative validation and PDF generation; the page must handle the response. The core does not turn every form into a finished PDF application.

For offline work, decide where an explicit save goes and how it will later be delivered. Network access, CORS and CSP still apply when contacting an external service.

Your turn

Try it yourself

  1. Open Data exchange and save the example’s current record using its typed save action.
  2. Change a value, restore the saved record and compare the result.
  3. Inspect the JSON export and identify which representation your intended receiving service needs.

Check your understanding

Does downloading an offline page guarantee that the next browser session restores your edits?

Show the answer and expected result

No. Delivery and persistence are separate. The application needs a deliberate save/restore workflow or other storage. Test closing and reopening only after saving, and verify the actual result rather than assuming browser memory is durable.

Working examples and reference