TABLE OF CONTENTS
DAKboard can fetch data from other online sources via a URL. To use this feature, in the DAKboard options, under Custom Screen Settings, click the Add a Block button and select External Data/Fetch. Resize/move the block as needed, then click the pencil icon to edit the block settings. Here you'll see a URL field where you can enter the URL of your text/JSON file.
NOTE: Your JSON file's URL must be a web-accessible secure site to be able to be used with this service. We cannot pull data from local sources.
The format of the data DAKboard is expecting should be one of the following formats:
Plain Text:
DAKboard will fetch and display plain text from a URL:
Sales today: 176
JSON Object:
DAKboard can also fetch a JSON object in name-value pair format like the following example:
{
"status":"active",
"temperature":"38",
"timestamp":"2018-09-12 16:23:11"
}
After adding the URL in the Fetch block settings, you can then select which data points to show on DAKboard, and set a name and optionally a description and icon:
Save changes to the Fetch block, and it will appear on your DAKboard looking like this:
JSON Array:
DAKboard can also fetch an array of JSON data formatted as follows:
[
{
"value":"176",
"title":"Sales",
"subtitle":"Today"
},
{
"value":"194",
"title":"Sales",
"subtitle":"Yesterday"
}
]
Value is a required field. The title and subtitle are optional.
Authentication:
DAKboard supports fetching JSON data with the following authentication methods:
- None
- Basic (username/password)
- Bearer Token
Custom Images from JSON Data:
In the JSON block settings, you can enter another JSON field name into the "Icon Name" field to display an image from a URL that is part of the returned JSON:
The icon name should be appended with two underscores ( __ ). If it's multiple levels deep in your JSON data, it would look like:
levelOne__levelTwo__url
This adds the URL to an img tag and displays it on the screen. We gave it a class name of JSON-data-icon if you need to style it further in the custom CSS.
Also, just a note: that URL field could also contain a FontAwesome icon class name if you wanted to provide the class name and use the existing icon set.
Additional Formatting:
DAKboard supports the additional formatting of data. These can be found under the Formatting Tab as seen below:
They include the following:
- Number Manipulation: This will allow you to use the following methods to adjust your Numbers:
- Divide by
- Multiply by
- Fahrenheit to Celsius
- Celsius to Fahrenheit
- Number Format: This allows you to set the format your Numbers will take.
- Round Values: This allows you to round out your values to a specific decimal place.
- Truncate Values: This allows you to truncate the value after a select number of characters has been met.
Rules Tab:
Recent updates have added some new tools you can use with your External Data / Fetch block. The first of these additions is the Rules Tab as seen below:
The Rules Tab can be used to add effects to your block. It uses an IF/THEN statement to accomplish this. As an example, you can use it to set colors to the Text of your JSON data as follows:
In the example above, when your JSON value equals 100, your text color will be green, when it is 200 it will be yellow, and when it is 300 it will be red. You can modify this further by changing what the JSON value matches for the IF statement, selecting different actions in the THEN statement, or even adding more THEN results with the AND button. See below:
- IF Statement Value Matches:
- THEN Statement Actions:
- Additional THEN Actions:
This way you can customize your results.
Frequently Asked Questions:
Can you add time or date stamps in the JSON formatting?
Currently, you cannot append date time stamps in your JSON formatting as DAKboard cannot use them.