Skip to main content

Working with views

info

This content is intended for advanced Studio users.

Views are AQL queries saved to the EHR server and exposed as API endpoints. For an introduction to views and how to save your first query as one, see the Saving and reusing queries section. This page covers what to do with a view after it has been saved: loading, editing, deleting, and connecting it to a form via a data connector.

Managing views​

The Views section of the left panel lists all views saved to the EHR server for the current project.

From this panel you can:

  • Load a view: Select it to populate the query editor with the saved query.
  • Edit and re-save: Modify the query, then save using Update view.
  • Delete a view: Remove it from the EHR server.
warning

Deleting a view removes it from the EHR server immediately. Any data connector or application that calls the deleted view will fail at runtime. Confirm that no active data connectors depend on the view before deleting.

Connecting a view to a form​

Once a view is saved, you connect it to a form using a data connector in Form builder.

To connect a view to a form:

  1. In Form builder, open the form you want to connect data to.
  2. Navigate to Data connectors in the bottom toolbar.
  3. Create a new data connector and select the view from the available views list.
  4. Map any view parameters to form fields, session variables, or fixed values.
  5. Configure when the connector triggers.
  6. Bind the returned data to the relevant form fields.

For full data connector configuration steps, see the Connecting data section.

Updating a view​

To update a view:

  1. In the Views section of the left panel, select the view you want to update. The query loads into the editor.
  2. Make your changes.
  3. Click Save and select Update view (or Save as view with the same name to overwrite).

Updates take effect immediately for all applications and data connectors that reference the view.

Frequently asked question (FAQs)​

What is the difference between a view and a snippet?

A snippet is a reusable query or query fragment stored locally in the AQL builder for quick insertion during query writing. A view is a complete AQL query saved to the EHR server and exposed as an API endpoint. Use snippets to speed up query authoring; use views to make queries available to applications and data connectors.

Where are views stored?

Views are stored on the EHR server, not locally in Studio. When you save a query as a view, the EHR server exposes it as an API endpoint that your application can call.

Can I use parameters in a view?

Yes. Add parameters to your AQL query using the :parameterName notation before saving as a view. Each parameter becomes an API endpoint parameter on the saved view. See the Refining queries with parameters section.

How do I connect a view to a form?

Use a data connector in Form builder. Create a new data connector, select the view from the available views, map any parameters, and bind the results to form fields. See the Connecting data section for full steps.

Can I edit a view after saving it?

Yes. Load the view from the Views section of the left panel, make your changes in the query editor, and save using Update view. Updating a view takes effect immediately for all applications and data connectors that reference it.

What happens to my application if I delete a view it depends on?

Any data connector or application call that references the deleted view will fail at runtime. Always check which data connectors reference a view before deleting it.

Can I update a view after saving it?

Yes. Load the view from the Views section of the left panel, make your changes, and save again. The update takes effect immediately for all dependent data connectors and applications.