# Adding, editing or deleting rows

**URL:** https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476
**Category:** Ask for Help
**Created:** [December 9, 2024, 8:02pm UTC](https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476 "2024-12-09T20:02:53Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)
#### Post date: [December 9, 2024, 8:02pm UTC](https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476/1 "2024-12-09T20:02:53Z")

</div>

My app is about managing your expenses. It has a table called EXPENSES and when a user registers an expense, he/she chooses a category and subcategory (for example FOOD and then SUPERMARKET or RESTAURANT, etc). I have pre-populated CATEGORY and SUBCATEGORY tables, with all the corresponding relations between tables. The user can edit or delete a category or subcategory (only when there are still no expenses related to it). Or even add a category/subcategory. Here is the problem: to show the default categories/subcategories to all users, the columns cannot be user-specific. But when a user chooses to edit/delete a category/subcategory, I wish the columns would be user-specific so that it does not affect other users. When adding a category, I could populate a UserID column so only this user can see his new category. But what can I do when the user edits or deletes?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [December 9, 2024, 9:02pm UTC](https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476/2 "2024-12-09T21:02:56Z")

</div>

Normally I would recommend row owners, but you can’t mix rows under row ownership with rows that are not. A way around it is to utilize Roles and give each user the same role, but that’s different can of worms.

I think what I would do is add a column to your category and sub category tables to hold a User’s RowID value. So when the user adds a category or sub category, you also write the row id from the user profile to those tables.

So ultimately, you would filter your choice components to only show items where the user’s ID is empty (default options) OR matches the RowID in the user profile (user’s options).

---

<div class="post-metadata">

### Author: ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)
#### Post date: [December 9, 2024, 9:09pm UTC](https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476/3 "2024-12-09T21:09:18Z")

</div>

What you suggest would solve the problem when user ADDS a category. But it doesn´t when user deletes or edits a category, right?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [December 9, 2024, 9:17pm UTC](https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476/4 "2024-12-09T21:17:25Z")

</div>

Yes the ID would be written when they ADD a category.

Why do you think it would be a problem if they edit or delete the category they created and is only visible to them? It’s their category. The ID never changes, so the row is linked to them until they delete it.

---

<div class="post-metadata">

### Author: ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)
#### Post date: [December 9, 2024, 9:38pm UTC](https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476/5 "2024-12-09T21:38:08Z")

</div>

It would not be a problem if they edit or delete the category THEY created. But it would be a problem if they edit or delete the default categories (the categories that already come with the app). Right?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [December 9, 2024, 10:00pm UTC](https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476/6 "2024-12-09T22:00:28Z")

</div>

Don’t let them edit the default categories. You can easily condition the edit button so it’s only visible on categories they created, or only show them a collection of their own categories.

---

<div class="post-metadata">

### Author: ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)
#### Post date: [December 9, 2024, 10:29pm UTC](https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476/7 "2024-12-09T22:29:50Z")

</div>

OK, that´s a decent alternative. I wont let them edit or delete the default categories. Just the ones they create. Thanks!!!

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [December 16, 2024, 10:30pm UTC](https://community.glideapps.com/t/adding-editing-or-deleting-rows/78476/8 "2024-12-16T22:30:25Z")

</div>

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