VOLUME LXXXII              05/11/2021

Have you ever wished you could use Ninox to fill out forms?

Ninox FormsPLUS is Coming Soon!

Executing Ninox Scripts Via API

By Adam Davidson, Director of Product Management

Ninox has included a great tool in their API which is the ability to send in scripts in the body of a request that will be executed in the cloud against a database. This opens up a huge range of possibilities if you are integrating a third party app or your own custom software with Ninox, or you would like to run a script on one database from another database in Ninox.

There are two ways to send a script for Ninox to execute. One is by inserting the script as a query parameter in a GET request, and the other is by inserting the script in the body of a POST request. I would recommend the latter method since there isn’t the need to URL encode (replace spaces and other special characters with codes like %20) the script in the body of the request.

To use the POST method, send the script in to

https://api.ninoxdb.de/v1/teams/:teamid/databases/ :databaseid/query

replacing the :teamid and :databaseid with the team and database ids of the database on which you would like to run the script. the body of the request should be a json object with a single property named “query” whose value is the script to be executed. See an example below:

{ “query”: “(select CLIENTS where STATUS = \”active\”).(‘FIRST NAME’ + \” \” + ‘LAST NAME’)”}

This example body would get an array of the full names of each record in the CLIENTS table where the client status is active. Notice the \” is used in place ” to let the json know that the quote is part of this string, and not an instruction to end the string.

Any script that would be run in a global function can be sent in the body, (making sure to escape double quotes with \”). Send the API key in the Authorization Header as “Bearer ” + , and include the ‘Content-Type’ header as ‘application/json’ as in any other Ninox API request and you will be good to go.

Go HERE to see the documentation for the request format and all the other possible Ninox requests.

Go HERE to see how you could send in this request from a Ninox script using the http() method (good for if you would like to run a script on one database from another database).

New Step-by-Step Tutorial On the Way

Transforming CSV's and Excel Spreadsheets into Related Tables- Available Thursday the 13th

Decreasing Database Runtime

By Michael Sidenstick, Programmer/Developer

While learning the fundamentals of good programming principles in college, one of the most important lessons I was taught was on the topic of code runtime. If you’ve ever been frustrated by websites loading slowly or software taking forever to load, you already know why decreasing code runtime is so important– no one wants to sit for a minute waiting for some software to finish running. This past semester at college, I had a digital logic class where we designed logic circuits and running just one simulation would take three or four minutes. Decreasing the load time and runtime of programs can increase efficiency and reduce frustration drastically.

So, when it comes to Ninox, what makes programs run longer, and how can we make our databases run more efficiently? Let’s consider the lowest unit of runtime a calculation; if we write a formula that performs the calculation 7 + 11, this is considered one ‘operation’. The number of operations a program performs is what determines the runtime– programs running hundreds of operations will take far longer than a program with only a few. Some functions or chunks of code have greater runtimes based on the fields they update, or on the complexity of the task they are accomplishing. The cost of each line isn’t easily determined in Ninox, because writing a line such as “x := 5000” perform assignment, which Ninox handles in an unknown way in the backend, and each native Ninox function has a different unknown runtime as well.

To understand how to optimize your programs, you first must understand where the problem is coming from. One large source of slowdowns comes from code written to work correctly, but not to work efficiently. Functions with large amounts of lines that haven’t been organized often contain unnecessary lines that slow down the system and reduce readability. Additionally, different solutions to the same problem can often run at very different speeds. If you wrote a button that cleared a record upon being pressed, if there were many fields to be cleared, each clearing could take something like 10 or 15 seconds. However, alternate solutions could be tested that may run faster; for instance, instead of clearing every field in a record, just delete the record and create a new one at the same time to ‘clear’ the fields.

If you have a database running slowly, the best course of action is to first diagnose where the slowdowns are coming from, and then to troubleshoot potential solutions by cutting down on unnecessary code, searching for alternate solutions, or tackling the problem in a different way.

This Week in the Learning Lab

Be sure to join us this Thursday the 13th at 12pm EDT for an open Q&A session. Be sure to bring questions!

Check Out Our Templates

Did you know that Nioxus has built over 150 templates which are available to all Standard, Deluxe and Premier Nioxus members?

Nioxus University YouTube Channel

Nioxus has created nearly 100 videos and over 200 hours of content teaching you how to use and optimize Ninox, as well as our supplementary products: CalendarPLUS, ReportsPLUS and DocumentsPLUS!

Just Jim

By Jim Harris, Stargazer

You fun people sure were excited about our class two weeks ago at the Learning Lab on Security Groups and Database Protection. I know that I learned a thing or two myself!

After that class, I got a hankering to go back and review our Nioxus YouTube Channel and revisit 600.11 Advanced Audit Trail & User Event Tracker, 600.12 Role Based Security and 500.03 Password Protection & Databased Security. It felt great to brush up on those topics and I even discovered tips and tricks that I had missed the very first time that I watched them. It was like finding hidden treasures in the drawer of my dresser… not just the usual mismatched socks! Here is a link to our YouTube Channel so that you can check it out for yourself: https://youtube.com/c/NinoxLearning.

We also have an open Q&A every other week discussing whatever topic or question you wish for or dream up to discuss. Last week’s Learning Lab was our Open Q&A and was as usual, a huge hit. For the past 6 weeks, every webinar has hit triple digits. Let us know what topics, templates, videos, or content tickle your fancy by contacting me directly at jim@nioxus.com.

On a fun note did anyone see that some weeks ago, a nine-year-old macaque monkey called Pager successfully played a game of Pong with its mind? This is not science fiction folks. Elon Musk’s neurotechnology company, Neuralink, has implanted a coin sized disc by surgical robot into Pager’s brain so that thousands of micro threads are connected from the chip to neurons to control motion.

They had Pager play Pong the normal way using a joystick. Every time he played a correct move, he was rewarded with a banana smoothie. As he was doing this the Neuralink implant recoded the patterns of electrical activity in his brain. That way they could identify which neurons controlled which movements. They were able to disconnect the joystick and he played Pong using only his mind! So, imagine how much this could help people with brain injuries like paraplegics and stroke victims. They could be liberated by doing things for themselves again.

Here’s the most exciting part… brain-machine interfaces could also offer a much faster way of interacting with computers compared with the current methods that involve using hands or voice. You could type a message at the speed of thought and not be limited to your own dexterity. Wait it gets better… we might be able to connect brains to the cloud. We would be potentially able to exchange information in seconds instead of doing it verbally which takes longer. According to Musk, Neuralink’s human trials are going to begin the end of this year! I think I’m going to need more than a banana smoothie to get me convinced to do it!



Copyright 2021 © All Rights Reserved.

All logos, trademarks and names are the protected property of Nioxus Corporation or their respective owners.

“Ninox,” “Ninox Database” and the blue Ninox owl eye logo are the property of Ninox Berlin and are used with permission.