How to create a countdown timer Datablock

There is not a pre-built countdown timer available in Databox, but a countdown Datablock can be manually built using Google Sheets, Terminal, or custom data

HOW TO

How to create a countdown timer

In this section, we'll walk through an example and create a countdown timer Datablock using Terminal. 

For our example, let's assume it's January 2020 and we want to create a countdown timer that displays how many months are left in the year. 

In order to create a countdown timer using Terminal, we will need to manually push the countdown values that we want to be displayed. 

For December 1st (2020-12-01), we'll push the value 1 to our "Countdown" Metric. This is because in December, we want the countdown timer to show that there is 1 month left in the year. 

For November 1st (2020-11-01), we'll push the value 2 to our "Countdown" Metric. This is because in November, we want the countdown timer to show that there are 2 months left in the year. 

We'll repeat this for every month in 2020. This will end with January 1st, 2020, where we'll push the value 12 to our "Countdown" Metric.  This is because in January, we want the countdown timer to show that there are 12 months left in the year. 

This can all be done at once through the Terminal code below: 

[
{
"$Countdown": 1, 
"date": "2019-12-01"
},
{
"$Countdown": 2, 
"date": "2019-11-01"
},
{
"$Countdown": 3, 
"date": "2019-10-01"
}, 

"$Countdown": 4,  
"date": "2019-09-01" 
}, 

"$Countdown": 5,  
"date": "2019-08-01" 
}, 

"$Countdown": 6,  
"date": "2019-07-01" 
}, 

"$Countdown": 7,  
"date": "2019-06-01" 
}, 
{
"$Countdown": 8,  
"date": "2019-05-01"
}, 

"$Countdown": 9,  
"date": "2019-04-01"
}, 

"$Countdown": 10,  
"date": "2019-03-01"
},
{
"$Countdown": 11, 
"date": "2019-02-01"
},
{
"$Countdown": 12, 
"date": "2019-01-01"
}
]

How to use a countdown timer on a Databoard

1
 From the Designer, click the Visualization Types icon on the lefthand side of the Designer
2
 Drag and drop a Number Datablock onto your Databoard 
3
 Using Datablock Settings on the righthand side of the Designer, select the Data Source and "Countdown" Metric that you used to create the countdown timer 
4
 We'll select  Month to Date as the Date Range since our countdown Metric is counting months. If we had created a daily countdown Metric, we would need to select Today as the Date Range
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us