# Debt Pay Down Database

**URL:** <https://connect.superhuman.com/t/debt-pay-down-database/31268>\
**Category:** Ask the Community\
**Created:** [June 5, 2022, 6:36am UTC](https://connect.superhuman.com/t/debt-pay-down-database/31268 "2022-06-05T06:36:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlaidPixels](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/plaidpixels/32/27217_2.png) [@PlaidPixels](https://connect.superhuman.com/u/PlaidPixels)\
**Post date:** [June 5, 2022, 6:36am UTC](https://connect.superhuman.com/t/debt-pay-down-database/31268/1 "2022-06-05T06:36:53Z")

</div>

Hi everyone! Like most here, I’m brand spanking new to Coda and am trying my hand to convert from Notion. I like Coda because I understand it’s formula centric but am not sure how to create the formula I’m seeking. Maybe someone with some experience can help me.

Here’s what I’m trying to do. I have created a database complete with all of my debts, when they’re due, how much is owed, a debt category (credit card, loan, et al), the name of the creditor and a bit more. What I want to do is enter an amount (a credit or a charge) and have that amount add to or deduct from the balance as well as records the date/time that it occurred. While I could do this in spreadsheet form, I don’t want that. I want a page that shows at-a-glance my debts that has a “widget” style form that records the payments/credits and charges.

Make sense? So, how do I do this? 🙂

---

<div class="post-metadata">

**Author:** ![Christiaan\_Huizer](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/christiaan_huizer/32/28269_2.png) [@Christiaan\_Huizer](https://connect.superhuman.com/u/Christiaan_Huizer)\
**Post date:** [June 5, 2022, 8:12am UTC](https://connect.superhuman.com/t/debt-pay-down-database/31268/2 "2022-06-05T08:12:19Z")

</div>

hi @PlaidPixels, Welcome to the community and thx for the interesting question.

I start with a possible part of the answer, to proceed you might want to add a sample doc with some fake data. How to share a doc, [please check here](https://help.coda.io/en/articles/1137949-sharing-your-doc)

This is a set up I created with a button a as a starter. It does not deal yet with calculations. The important aspect is the logic we follow. If you feel unhappy with the code I shared, don’t worry you can add this data manually as well.

I started with a table on the categories

 ![image](https://global.discourse-cdn.com/coda1/original/3X/4/3/43d73b260490c24005651914356025895d5479d9.png)

 ![image](https://global.discourse-cdn.com/coda1/original/3X/8/0/803896dc90dc40da815cec05b7023764581766ac.png)

Next a created a button that links to this table and a text box to create the table to work with:

 ![image](https://global.discourse-cdn.com/coda1/original/3X/e/e/ee0df62d306918df8d253db0c81b4c260fe22679.png)

and the code in this button you find below:

```auto
Sequence(1,12).FormulaMap(CurrentValue.WithName(MonthNumber, 
  
  Sequence(1,[DB Debt Category].Count()).FormulaMap(CurrentValue.WithName(Nbr_Debt_Cat, 
  
[DB Debt].AddRow(
 [DB Debt].Name, Format("{1} → {2} ",
   Date(TB_DebtYears,MonthNumber,01).MonthName(),
   [DB Debt Category].Nth(Nbr_Debt_Cat)),
[DB Debt].Month,MonthNumber,
[DB Debt].MonthStart,Date(TB_DebtYears,MonthNumber,01),
[DB Debt].TheMonthName,Date(TB_DebtYears,MonthNumber,01).MonthName(),
[DB Debt].DebtCat,[DB Debt Category].Value.Nth(Nbr_Debt_Cat)
)))))

```

The main thing is as said before not what you see in the code (you can do this manually as well), **it is about the structure** that for each month you have debt categories and of course you can add more details per month.

This is the start, once we have this, we can start adding numbers and playing with it.

hope it helps, Cheers, Christiaan

---

<div class="post-metadata">

**Author:** ![PlaidPixels](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/plaidpixels/32/27217_2.png) [@PlaidPixels](https://connect.superhuman.com/u/PlaidPixels)\
**Post date:** [June 19, 2022, 10:27pm UTC](https://connect.superhuman.com/t/debt-pay-down-database/31268/3 "2022-06-19T22:27:52Z")

</div>

Holy Moly, Christiaan…. that’s incredible and I have to figure out how you did that and where, well, to put it! LOL!

I’m quite grateful for the work you did and thank you immencely for it!

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [June 22, 2022, 10:28pm UTC](https://connect.superhuman.com/t/debt-pay-down-database/31268/4 "2022-06-22T22:28:11Z")

</div>

Closed on June 22, 2022, 10:28pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
