Dashboards

Long time user of Knack. Our entire production management and order processing is on Knack and we’d be lost without it.

We’re expanding and getting busier, and its getting harder to get a view of our current situation from reading tables. I recall seeing someone had found a way of producing a ‘tile’ which has, say ‘Order value taken this month’ or number of sales. Both are easy numbers to get at, but not easy to display. Has anyone got something they could suggest or point me at the earlier article. I’ve searched and it just isn’t appearing.

Second, I’ll sneak this in, we take orders direct from clients through a portal, but when they arrive, it sure would be great to be able to hear a ‘ding’, a bell, a claxon, or something else to tell us that we have something to respond to. We have an email notification which dings our phones, but as we work in a busy and noisy environment, they get missed. Same question. Anyone done this already.?

1 Like

Hi @NeilParkin60970

You should find what you want in my blog post:

Hope this helps!

Julian

2 Likes

You can achieve this with text formulas and some CSS to set up the display.

Here is a sample from our site:

To answer your other question, you can use integromat (now make) to set this up. Maybe do an integration with Twilio to send a text message, or set up an email connector to send you a message anytime a new record is created.

We recently set up a solution using make and Twilio that allows users to use our app to mass text a message to their users after a form submission.

1 Like

Hi Neil,

I’ve done the audio part of your question. It’s a dashboard that monitors the Knack devices connected to the App, and validates that they’re up and running 24/7 with heartbeats every minute. Works like a charm. But if ever a sequence of 3 heartbeats are missed, I sound an alert and send myself an email.

So here’s an extract of the code I’ve written to add the playback in the app. You can upload an mp3 of your choice in Knack and get its URL to use as the 2nd parameter.

var alertTriggered = false;
var wantToHearSounds = true;

//audioId is just a unique ID string.
//audioSource is the URL of an mp3 file.
function waitAudioReady(audioId = '', audioSource = '') {
    return new Promise(function (resolve, reject) {
        var audio = document.getElementById(audioId);
        if (audio)
            resolve(audio);
        else {
            audio = document.createElement("AUDIO");
            audio.id = audioId;
            if (audio && audio.canPlayType("audio/mpeg")) {
                audio.setAttribute("src", audioSource);

                //Do not show controls.  Uncomment next line to show, if ever needed.
                //audio.setAttribute("controls", "controls");
                document.body.appendChild(audio);
                resolve(audio);
            } else {
                reject('Error - device or browser can\'t play sounds');
            }
        }
    })
}

if (alertTriggered) {
    waitAudioReady('deadTerminalAlert', 'https://api.knack.com/v1/applications/YOU_APP_ID/download/asset/SOUND_RECORD_ID/deviceofflinealert.mp3')
        .then(function (audioAlert) {
            if (audioAlert) {
                if (wantToHearSounds)
                    audioAlert.play();
            }
        })
        .catch(reason => { console.log(reason); })
}

Typically, you add the call to waitAudioReady in a view render handler, and check the values of the tables for some trigger.

If you like this, go check out my KTL - it’s amazing!

Enjoy,
Normand D.

1 Like

Hi all,

really appreciate your assistance.

Julian, yours was the document I’d seen ages ago, thought it was brilliant, then immediately forgot where I’d seen it…!

Plenty to keep me busy

Thanks again

Neil

1 Like