• Home
  • Custom Programming

Programming TouchPoint Using Python and SQL

Programming TouchPoint Using Python and SQL

This is your guide to how you can use Python and SQL to make TouchPoint sing to your own tune.

Custom Recipes

A great way to learn programming TouchPoint is to use some of our custom recipes for examples of what you can do.

Below are what we call recipes for both Python and SQL Reports. These are step-by-step instructions, complete with the code you can copy and paste into your database. This makes it easy for someone who is not proficient in these programming languages to create these specific reports.

Both SQL and Python reports have the option of being added to either the main Reports menu or to the Blue Toolbar. After running the report, there will be a link at the bottom. It is Add Report to Menu. If the report is suited for the Blue Toolbar, the recipe will contain the code necessary to place it there, should you choose to add it to the menu.

Without that code, the report will appear on the main Reports menu, when you choose the option to add to menu.

Reports that are suited for the Blue Toolbar are those that depend on a set of individuals, such as an organization, a Tag, or Search Builder results. Other reports should appear on the Reports menu, because they are more global in scope.

Writing Your Own Scripts

We prefer that you develop your SQL scripts on a local copy of your database before you install them in your production database. That is what we do so that we can perfect the code and know that it does not have errors and is performant. When you develop and test in your production database, we see every error messages every time you make a mistake and it could cause performance problems for other churches if you write an untested script that hogs resources unnecessarily. And even though there is no danger of damaging anything since you will have read-only permissions through SQL on the production database, you can hog resources since you share a database server with all of our other churches.

A backup of your database can be loaded, for example, into Microsoft SQL Server Management Studio, where you can test your SQL scripts. From there, you will be able to see the database schema.

Latest Update 2/22/2022

Add link to Nightly Database Backups article