Creating Widgets (SQL)

 > Widgets > Creating Widgets (SQL)

Pre-requirements

To create widgets from SQL queries you must:

 

Introduction

By default the Widget Creator is in Interactive mode (drag & drop).
To use the Query mode you must select the Code Editor.

There are two ways to create widgets from SQL:

  • You use the interactive mode (drag&drop) to create a widget and then use the Code Editor to fine tune the SQL generated by Viur.
  • You use the Code Editor to create a widget from scratch using your SQL queries.

Note
We support the transition between interactive mode to query mode so you can take a look at the generated query and do some fine tunings.
But not the other way around, once you alter the SQL and wish to return to interactive mode, all additional changes will be lost.

 

Choosing the Data Source

The fist step to create a chart is to select the database.

Use the dropdown to select the Data Source you wish to use: Choose SQL Database

 
You will notice on the left panel the database schema, and and that the Code Editor button is now enabled.

Loaded database schema

 

Starting with the Code Editor

Once in Code Editor type the desired query:

SQL query

 

Scrolling down you'll still see the table results as usual.

SQL query

Still need help? Get in touch!
Last updated on 16th Oct 2018