Creating Custom Query Widgets
This article provides instructions for turning a query into a widget to place on the Homepage/Dashboard.
Establishing the SQL
Create a Quick Query with the desired exports and filters. If you plan to frequently update or change the filters on the query, you may want to save it as a New Query instead; otherwise, a quick query will suffice. For more information on creating Queries, please reference the Related Articles section at the bottom of this article.
When selecting exports, it is good to keep in mind that the widget serves as a snapshot, and displays best when you have 2-4 exports or the data can become truncated. You also cannot interact with the widget to send an email or access a record. It will only provide a display of the information.
Once you are happy with the query results, you will need to copy the SQL. To do this, click on the Display SQL button in the upper right menu.
A window will pop up that displays the SQL code. Scroll down to the bottom, then highlight all of the text dragging up to the top.
Creating the Widget
Navigate back to Queries / Reports by clicking on All Queries in the breadcrumbs, or the icon in the main menu across the top.
Click on Widgets in the menu on the right side of the page.
Click the button to create a New Widget.
Set a name for the widget. If you want it to show on the Homepage, you will need to begin the name with “Homepage”. Click Save.
On the Widget Builder page you will see an Add Chart dropdown menu. Select the last option to create a custom SQL chart.
Once you select the option from the drop down menu, it will pop open a new window. You can create several charts on a single widget, so you will need to give this chart a specific name. Select the column chart type, then paste your copied SQL into the SQL box. Click Save.
Sharing & Displaying the Widget
You will need to edit the Sharing Permissions for the Widget to display it for other users. On the Widget Builder homepage, click the Share button in the upper right corner.
A window will pop up that allows you to Edit Permissions. Click Add Grantee to add a new user/role, or click on an existing permissions to edit.
You may assign the widget either to individual users, or by role. If you select User, you will need to add individual users one at a time.
Once you select the Type, you will need to select the User or Role.
Once done, make sure you check the box to Display the widgets. Click Save.
Impersonate the user to ensure that the widget appears properly on the homepage.
Making Changes to the Chart
If you need to make changes to a custom SQL chart, you will need to update the SQL. Create a new query with the appropriate exports and filters. Go back to the widget and click to Edit Chart. Replace the SQL.
For queries that you have saved, you will still need to follow the same steps; update the query, copy and paste the SQL. Changes made to the original query will not update the widget chart, as they are not directly linked.
- When copying the SQL from the query, if you click and hold at the start of the text and try to pull down, you may have difficulties highlighting all of the text. Starting from the bottom and highlighting by going up the wall of text should give you no issues.
- If you have multiple homepage widgets, each one will show as a different tab; the name on each tab will be whatever follows the word homepage.
- The charts display with the name of the chart.