Table of Contents

Query and VisualQuery

you are here (click to zoom) - discover the stack

2sxc Templates and Headless APIs can use Queries to access data. This is pretty amazing:

  1. You create such queries using a VisualQuery designer
  2. Queries can then be assigned to a View so the template recieves this as the data to work with
  3. Queries can also be used directly in the Headless API if you configure the permissions for this
  4. The Edit-UI can also use queries in dropdown fields
  5. You can also access queries using App.Query["QueryName"]

In addition, there are also some built-in System Queries built-in which will get system data for you like a list of Content-Types or Apps in the System.

Tip

Note that Queries can created in code and using VisualQuery. The code method is very advanced. You can read more about using DataSources in C# / Razor code. The rest of this page is about VisualQuery.

Queries in an App

All Queries (except for the System-Queries) are stored in the App - this is what it looks like:

Create Queries

To create a new Query hit the + and continue from there:

Edit Queries

Use the VisualQuery Designer

Export / Import

👉 Export / Import Queries

Technical Implementation

When queries run they behave like Data-Sources while internally chaining various other Data-Sources to query the underlying data.


History

  • introduced in 2sxc 6
  • continuously enhanced