# Logic to decide when to add new row or edit existing

**URL:** <https://community.glideapps.com/t/logic-to-decide-when-to-add-new-row-or-edit-existing/24375>\
**Category:** Ask for Help\
**Created:** [March 16, 2021, 8:02pm UTC](https://community.glideapps.com/t/logic-to-decide-when-to-add-new-row-or-edit-existing/24375 "2021-03-16T20:02:43Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![jauyong](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jauyong/32/23477_2.png) [@jauyong](https://community.glideapps.com/u/jauyong)\
**Post date:** [March 23, 2021, 8:51pm UTC](https://community.glideapps.com/t/logic-to-decide-when-to-add-new-row-or-edit-existing/24375/8 "2021-03-23T20:51:08Z")

</div>

Hey, sorry for all the questions, but I’m still not able to get there.

1. If there was no entry for the current day, allow the user to add a new one. **I am unable to do this part.**  
a. How do I implement the above logic check and then trigger a form that will allow the text input and auto-enter the current date and the signed-in user to a new row? Is this logic done in the page setup rather than in the table?
2. If there was an entry for the current day, allow the user to see a preview and edit the entry.  
a. I don’t have the logic in place for the above but I have achieved this by creating a page, who’s source is the user profiles table and I made the style = Details and on the screen, I added the relation column.

These are my tables. I also have 3 additional “entries” tables for different types of entries that can be entered on any given day, but I’m just trying to get one working first.

**User Profiles**  
Email | Name | Grateful Relation

**Grateful Entries**  
Email | Date | Today | What are you Grateful for? | If Else

 ![Frame 1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/3/634e0d2a83cf56e62cc5e2844bd3f99258fd05b0.png)

---

_[View the full topic](https://community.glideapps.com/t/logic-to-decide-when-to-add-new-row-or-edit-existing/24375)._
