Category: How do I do X?


This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How do I display a query result as a test?


I have a query that returns a single string result, but when I try to display it as a simple text widget, it shows additional unwanted data. I need to know how to show only the content of the result of the query.


The problem was that the result of the query was displaying as a JSON object with a count attribute. However, the goal was to display just the value of the count attribute as a string in a Text widget.

To solve this problem, use the following code in the Text widget: {{[0].count}}, where Query1 is the name of your query.

This code accesses the first object in the data array that the query returns (assuming it only returns a single object), and then accesses the count attribute of that object to display it as a string.

Alternatively, if you had multiple attributes in your query result object and only wanted to display one specific attribute, you could replace ".count" with the name of the attribute you want to display.