Let’s say you have a loan and want to split it into several monthly payments. Instead of manually calculating each monthly amount, determining the number of payments, and creating records for every payment, you can automate the process. Just click a button — sounds great, doesn’t it?
In this guide, we’ll walk through step-by-step instructions on how to create a custom button that generates payment records based on loan details. Each generated payment will be linked to the corresponding loan record.

Step 1: Create the Required Tables
You’ll need three tables:
- Loans
- Payments
- Indexes (a technical table used for generating sequential values)
Indexes Table
This table will contain a single numeric column named “Index”. Each record represents a sequential number starting from 1. The number of records in this table determines the maximum number of payments that can be generated for any one loan.

Loans Table should include the following columns: Name, Amount, Number of Payments, Start Date.

Finally, in Payments Table create the following columns: Amount, Date, Index (type: number), and Loan reference column (with lookup fields such as Loan Amount, Loan Name, Loan Number of Payments, and Loan Start Date)

Step 2: Set Up Relationships
In the Loans table, create a many-to-many relationship with the Indexes table. No match conditions are needed at this stage.

Next, under this relationship, create a recordset column and apply the following filter:
[Index]<=Related[Number Of Payments]
This ensures that only the necessary number of index records are related to each loan, based on the specified number of payments.
Step 3: Create a Custom Button
In the Loans table, create a Preview Page Custom Button named “Generate Payment Records”. As a next step, add a record create workflow action. This action called “Create Payment Records” will be generating the payment child records from the loan record. Add two assignments to this action: [Index] will be indicating the sequence number of a specific payment record within the batch (e.g. payment 2 out of 5), and Parentkey() will indicate the related Loan record.

Step 4: Automate Payment Field Calculations
To streamline the payment creation process, configure default values for the Amount and Date fields in the Payments table:
Amount Calculation: Automatically calculate the amount for each payment using this formula as a Default/Calculate in the column settings:
[Loan Amount]/[Loan Number Of Payments]
Date Calculation: Additionally, we will automatically set the payment date to the first day of the month following the loan’s start date. Use this formula as a Default/Calculate in the column settings:
AdjustMonth(FirstDayOfMonth([Loan Start Date]),[Index])
This formula ensures that each payment date is spaced one month apart, starting from the month after the loan begins.
Final Result
You can now create a Loan record, specify the start date, total amount, and number of payments. Then, simply click the custom button to automatically generate payment records — each with a calculated amount and scheduled date. Check the settings for this in our database templates library.
And you’re done! Finally, to take it a step further, consider adding reminders or notifications to help ensure payments are made on time.
It is great to be able to create records from a Recordset ! Thanks for this new feature at the same price.
For the example above, there is a solution with one Teamdesk REST API Create Call, with a payload like:
[]
[Which can be made shorter using Replace()]
Left(‘{“MyIndex”:”001″},{“MyIndex”:”002″},{“MyIndex”:”003″},{“MyIndex”:”004″},{“MyIndex”:”005″},{“MyIndex”:”006″},{“MyIndex”:”007″},{“MyIndex”:”008″},{“MyIndex”:”009″},{“MyIndex”:”010″},{“MyIndex”:”011″},{“MyIndex”:”012″},{“MyIndex”:”013″},{“MyIndex”:”014″},{“MyIndex”:”015″},{“MyIndex”:”016″},{“MyIndex”:”017″},{“MyIndex”:”018″},{“MyIndex”:”019″},{“MyIndex”:”020″},’,18*[NumberOfRecords]-1)
I have tested the solution proposed by Katerina (Updating from recordset) – it is much faster than my alternatives.