Exercise 1 - Inventory Manager

:white_check_mark: Job to Be Done

You have a collection of books or movies that you lend out to friends and family, but you’re tired of trying to remember who has what. You need a doc that is going to:

  • Have a record of every book or movie in your collection
  • Tell you what is checked out and by whom
  • Help you make recommendations

:hammer_and_wrench:Try to Use

:star: Bonus

Hello! So I’m trying to create a doc for this exercise, but I’m already stuck with a formula :melting_face:

I’ve created two databases (Books and Friends) and I wanted to create two buttons (One for books that are borrowed and one for books that are returned) with a dialog box, so I could select the books and the friend.

I've come this far:

Then I created this temporary table which nests the dialog box and added the buttons to cancel and confirm:

Dialog Box

But I’m having trouble with the “Confirm” button formula. Although it makes sense to me, apparently it doesn’t for Coda :sweat_smile:

What it was meant to do: Find the Friend I referred on the helper table and then add the books I selected on their “Has Books” column.

The Formula:

RunActions(
[DB Friends].Filter(Name = thisRow.Friend)
.ModifyRows(
[DB Friends].[Has Books], thisRow.[Select Books]
),
[LOG Inventory]
.AddRow(
[LOG Inventory].Message,
Format(
[Book Out].Text,
List(thisRow.[Select Books]),
thisRow.Friend
)
.ToText()
)
)

When I click on “Confirm”, it isn’t adding the Books on my Table DB Friends. Could somebody help me?

I’ve created a shared link to my doc:

Hi @Lucas_Prearo ,

The first thing to note is that the reference to the friend in the helper table is a reference to the row, so you don’t need to do the Filter().ModifyRows, you can just do Friend.ModifyRows, which is much simpler and neater.

I have added an additional button column to your helper table called “ConfirmTest” with an updated formula.

Also note that I have used the ListCombine formula, otherwise any existing entries in the “HasBooks” column for the person would be replace, whereas you want them added to.

Hope that helps,

Rohan :slightly_smiling_face:

1 Like

Thank you @Rohan_Mitchell for your help!
I spent about an hour going back and forth with these formulas and I couldn’t understand what was wrong. :sweat_smile:

1 Like