The VALUE report type is used to return a single piece of data. This comes in the following forms:
All VALUE report types will be string processed before any returning a value. This means that variables and parameters put in the data, and will be parsed out in runtime. For example $param1$ will be replaced with the value represented by param1.
If the report column 'AsWidget' is marked 'Y', the system will add html around the value, for the best use of values it is recommended to set 'AsWidget' to 'N'.
Due to Python evaluation not having a distinct starting string, all VALUE reports with an EVAL query must start their query with the string: "EVAL:".
What follows can be any expression that python would understand.
5+3 Returns 8
5<3 Returns False
"x" + "y" Returns "xy"
The following is a valid EVAL query:
EVAL: $param1$<5
The system will patch the value of param1 into the query and then evaluate whether or not it is greater than 5.
A JSON object can be detected in python, so no identifier needs to be given within the query. A VALUE report will detect the first key of the JSON object and return that, because it is looking for a single value.
{
"host": "echo.free.beeceptor.com",
"path": "/"
}
The above query would give the value: "echo.free.beeceptor.com".
HTTPS has a distinct start substring: "https", so the query must simply be the URL. Any URL that has a REST API response can be inputted into this VALUE report's query. If the response is in the form of JSON, the value of the first key will be the value of the report. If the response cannot be interpreted as JSON, the value of the report will be a string representation of the full response.
https://echo.free.beeceptor.com/ will give the following JSON response similar to:
{
"method": "GET",
"protocol": "https",
"host": "echo.free.beeceptor.com",
"path": "/"
}
Therefore the value will be "GET", because that is the value of the first key.
The URL https://google.co.za does not return a JSON object, so the value would be the full response that the system receives (Quite a large string).
XML does not require an identifier because its start is unique. The query can just be the XML document. The value of the report will be the value of the first key present. For example, with the following query used:
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
</catalog>
The value of the report would be "bk101". This has limited uses, in general it is better to use the TABLE REPORTTYPE when using XML.
Due to Markdown not having a distinct starting string all VALUE reports with a MARKDOWN query must start with the string: "MARKDOWN". After which a Markdown document can be inputted. Upon calling the report, the query will be turned into html that represents what the markdown represents.
The following query:
MARKDOWN:
# RabbitMQ Summary
## Simple Data send example
### Sending Data
A connection must be made, and a connection must be created:
```
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
```
Here localhost can be replaced with the ip address.
Will turn into the following HTML:
<h1>RabbitMQ Summary</h1>
<h2>Simple Data send example</h2>
<h3>Sending Data</h3>
<p>A connection must be made, and a connection must be created:
<code>connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()</code>
Here localhost can be replaced with the ip address.</p>
No identifier must be used for SQL VALUE reports because the 'SELECT' function is distinct to SQL. The first returned value from the query will be the value of the report. For example the query:
select 'hello', 'goodbye'
Will give the report the value 'hello'.