# Database Logic and management

**URL:** <https://forum.bubble.io/t/database-logic-and-management/364073>\
**Category:** Database\
**Created:** [March 21, 2025, 12:40pm UTC](https://forum.bubble.io/t/database-logic-and-management/364073 "2025-03-21T12:40:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![new\_bubble\_fan2024](https://avatars.discourse-cdn.com/v4/letter/n/ed655f/32.png) [@new\_bubble\_fan2024](https://forum.bubble.io/u/new_bubble_fan2024)\
**Post date:** [March 21, 2025, 12:40pm UTC](https://forum.bubble.io/t/database-logic-and-management/364073/1 "2025-03-21T12:40:46Z")

</div>

Hi everyone, Hope someone can help me in this regard.

I have this database structure:  
User who can have list of clients  
Client who can have list of documents  
Documents which are in text formats

in my app page, i have a table which shows the list of clients  
user can select a client to see clients’ documents  
then there is a table which shows the list of documents from one client  
User can see each document text by clicking on its icon and a popup shows the text.

now i want to give this option to edit the text of this document and replace the previous text with the edited one.

for saving this change, i think i need to use make change to a thing…, but i could not figure out how to do that.

I have this, but every time it just edited the last item, i do not know how to determine which item exactly should be replaced.

 ![Screenshot 2025-03-21 at 13.40.01](https://us1.discourse-cdn.com/bubble/original/3X/9/6/96e653b099790fed3c58cb06dc39590c0998506b.png)

---

<div class="post-metadata">

**Author:** ![QinisoG](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/qinisog/32/258308_2.png) [@QinisoG](https://forum.bubble.io/u/QinisoG)\
**Post date:** [March 21, 2025, 12:47pm UTC](https://forum.bubble.io/t/database-logic-and-management/364073/2 "2025-03-21T12:47:41Z")

</div>

Since the list of documents are inside a repeating group, I’d suggest using the current cell index as the item to edit.

So something like ‘Search for Documents:item#current cell index’

I’d have to replicate this issue in an editor to be sure, but something along those lines.

Or when you click a document you could set the url parameter to be a number and the number would be the selected cells index and then you use the url parameter as a reference point for the cell to edit

---

<div class="post-metadata">

**Author:** ![ademiguel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ademiguel/32/245027_2.png) [@ademiguel](https://forum.bubble.io/u/ademiguel)\
**Post date:** [March 21, 2025, 1:18pm UTC](https://forum.bubble.io/t/database-logic-and-management/364073/3 "2025-03-21T13:18:16Z")

</div>

Since this is an API endpoint, why don’t you simply pass the Document to edit as an argument? No need to use a `Do a search for` expression.
