© 2019 by Kirkness Associate Ltd

Triggering Integromat from Ninox

A week or two ago now, Integromat introduced their Ninox app which now means that Ninox users have the option to use Integromat to integrate Ninox apps with email, web forms, accounting apps and even send push notifications!


Excited, the other day I started to set up an Integromat Scenario which I intended to be triggered by a new record in my test database:



Having set this up, I then wondered why nothing was happening - after all with Knack that's about all you have to do - any data edits will then trigger the process.


It was then I realised that I would need to set something up at the Ninox end as well and after a conversation with a developer at Ninox, I discovered I would need to call the WebHook created in my Watch Record Events module from an event in Ninox...


Setting Up the Ninox End of the Process


What I wanted to do was to create a Push Notification (Integromat's iOS and Android apps enable this) when something happened in Ninox - and I decided to trigger the notification via a button:


The database is VERY simple - it's just a table with details of some accommodation and a rental figure but I can use this to show the principles involved.


So, we have already created the Watch Record Events module (which involves connecting Integromat to Ninox which requires a Ninox API Key).


The next step is to click the Copy address to clipboard option in Integromat and then, go into the Formula option for the Notify button and enter the following code:


let data := {

RecordID: Id

};

let webhookURL := "https://hook.integromat.com/lma14j8vgne9fb37uepwvrXXXXXXXXX";

http("POST", webhookURL, {

'Content-Type': "application/json"

}, data)


Where the URL which is set to the variable webhookURL is the URL copied from Integromat.


What this code is going to do is to call the webhook and send it the Id of the current record (identified in the variable 'data'). Note that it is possible to send multiple values to the webhook but I prefer this approach which is a) simpler and b) always the same apart from the webhook's URL.


So, that's all that's needed to trigger the Scenario - I realise that it's a bit more work than with other apps but I thought it would be worth mentioning a couple of advantages of this approach:


  1. It's possible to trigger Integromat from any table or field after update event - or indeed anywhere where you can write code in Ninox

  2. The same Integromat Scenario can be triggered from multiple places in your Ninox app


Back to Integromat


Our one module Scenario doesn't yet do very much - you can run it, click the button in Ninox and see that it works - and gives you the value of the record ID but that's it.


As a next step in the process, I now suggest adding a Get Record module which will retrieve the record in Ninox from which the scenario was triggered:



This is quite simple and you can see that you can tell Integromat where the record comes from (in terms of your team, database and table) easily. The only slight difficulty is that the first step which provides the record ID receives it as text and has a leading Zero - the parseNumber Integromat function turns it back into a number and you can then use it to retrieve the correct record (including all it's fields).


Those that know Integromat will probably point out at this stage that this uses one more Operation than would be the case if the Ninox code were to send all the data to the webhook. This is true but I think this approach is more straightforward and easier to understand for the non coder.


Sending the Notification


You may not be aware that Integromat has apps available for iOS and Android - or that these include the capability (amongst a range of other things) for you to send push notifications from your other services! Once you have the Integromat app installed on your device and logged into your account, it's very simple to add the ability to send a notification:



Note that you are only able to send notifications to those devices with the Integromat app which are also logged into the account.


Finally, to give the Ninox user some feedback on the process, we'll add a module which will update the Ninox record to show that the notification has been sent:



And the great thing about Ninox is that this update will update on the user's screen as soon as it has run!


So there you have it - a very simple way to send push notifications from Integromat and a first look at how to make use of the Ninox / Integromat integration.


For more information about Ninox click here.


And for more info about Integromat click here.

222 views