We are happy to announce a little extension to our IFTTT integration: you’ll now be able to use queries in IFTTT to get your variable values into your applets. This lets you build very interesting applets including filter code to do even more with your applets.
As always, for complex automations that don’t require filter code, you can simply build them in Apilio directly!
To query a variable in IFTTT, you’ll just need to specify the variable name:
You’ll need to add filter code to use the information from the query.
brands are slowly adding queries to their services: https://platform.ifttt.com/blog/the-art-of-the-query and you can find these when you look at the service’s main page:
https://ifttt.com/apilio/details → Let’s you see all available triggers, queries and actions
Apilio is a Swiss Army knife, full of possibilities!
Even if a service in IFTTT today doesn’t have queries, you can build these yourself using Apilio as your storage service for data.
- Create a variable to store your data. Depending on the type of data you are storing, you’ll choose a boolean (yes/no, on/off information), a numeric variable (stores figures) or a string variable (stores text)
- Create an applet that starts with the service that is lacking a query: your trigger will be the information you want to gather and store for your query
- The action for your applet will be to update the variable you first created in Apilio
- You can now use this variable as a query in any applet
Here you’ll find some examples from IFTTT using queries and filter code:
You can also visit these three examples we have created to illustrate what can be build with Apilio’s queries:
You’ll see that you can use timestamps in your filter code for queries, remember these are always in UTC.
If you are using previous states for a variable that doesn’t have them, your applet will fail due to this. For example, using Slack:
const changeDate = new Date(Apilio.booleanVariableHistory.UpdatedAt); Slack.postToChannel.setMessage('Updated ' + Apilio.booleanVariableHistory.VariableName + ' from ' + Apilio.booleanVariableHistory.Value + ' to ' + Apilio.booleanVariableHistory.Value + ' at ' + changeDate.getHours() +':' + changeDate.getMinutes() + '\n Source: ' + Apilio.booleanVariableHistory.URL)
You can see we are using both Apilio.booleanVariableHistory and Apilio.booleanVariableHistory. But if the variable has no history, value 1 won’t exist. Please be careful if this is the case with your variables: make sure the history will be populated if you intend on using it.
As always, put them below, we are happy to help!