Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Update Record in Notion Database #69

Open
7 tasks
Nabhag8848 opened this issue Mar 6, 2024 · 12 comments · May be fixed by #70
Open
7 tasks

[Feat] Update Record in Notion Database #69

Nabhag8848 opened this issue Mar 6, 2024 · 12 comments · May be fixed by #70
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Nabhag8848
Copy link
Collaborator

Nabhag8848 commented Mar 6, 2024

What do we need?

  • Currently Once the Record is created using /notion create we don't have anyway to update that record from rc. lets say org is keeping track of project they are working on - in Notion Database and there is extension of project deadline, or it needs to assign to different person, xyz, etc. we can't do it currently which is needed and happens often.

  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

  • Open the Modal (Similar to Creation Record Modal particular when database is selected that view) with All the input Elements with initial value which is part of that record, Every Creation Message would have one particular record attached from database right, get that values through api first and open the modal with elements you need and give the current value of record to default value to elements, have the elements according to type of value, for reference use the code we already have for creation record.

  • similar modal we already have in create record feature right ? and update those fields which needed to be in one go in input elements the one which are not updated in the input fields doesn't matter cause we can make the request of changed value and default which wasn't changed and update the fields through API. This allows to make multiple fields change in one go.

  • Once the fields are filled, and updated through api when from modal the user presses Update (SubmitAction - BlueButton) We need to Update the Creation Message Particular from where the MessageBox Action was initiated, we need to update the message with new fields which were updated during the updation.

  • Also Make sure We handle ViewErrors,

  • Also Handle If when the there is update action button pressed the user is connected to workspace in which that database exist if not notify user you are connected to different workspace.

  • In this case, We currently don't have goal for menu actions: But make sure its scalable if we might need to include OverFlowAction Menu which is create database + create page or record which we should be able to do.

  • For Reference Check the Create Record Codebase you can find lot of code which will help you, you will need to know in depth things about how we are caching data with persistance storage.

Acceptance Criteria

  • Have a Message Box Action on creation message only - update record.
  • Opens Modal with Default Value
  • Checks the ViewErrors
  • Handles Incorrect Workspace connected on Message box action
  • Update the Creation Message to updated fields value
  • should be scalable to include overflowmenu actions later
  • It shouldn't break anything else🙏🏻🥹

Relevant ScreenShots

  • Include Update Record in Message Box Action of Creation Message
  • Update Record Modal Reference
Update Modal

Further Comments

  • Good Luck !! This is much needed and Hardest Features to Implement from all the Features in Notion App
@Nabhag8848 Nabhag8848 added the enhancement New feature or request label Mar 6, 2024
@Nabhag8848 Nabhag8848 changed the title [Feat] Update Created Record in Notion Database [Feat] Update Record in Notion Database Mar 6, 2024
@Nabhag8848
Copy link
Collaborator Author

Nabhag8848 commented Mar 6, 2024

@Spiral-Memory Created this issue, and lemme know what are some issues we will we facing and edge cases i may have missed.

  • Create Several Checkpoints throughout and make a draft PR right from beginning and keeping pushing. When one checkpoint is done lemme know cause reviewing entire codebase for this would be tricky that would make our life easier

@Spiral-Memory
Copy link
Contributor

Sure, @Nabhag8848 , I've reviewed the issue, and it seems interesting yet tricky to implement. I'll begin working on it soon and will keep you updated. Currently, I am building some prototypes to showcase for GSoC, and then I have to write proposals, so I might feel a bit slow. I will do my best to manage both. As you suggested, I will raise a PR and make incremental additions to it.

@Spiral-Memory Spiral-Memory linked a pull request Mar 6, 2024 that will close this issue
4 tasks
@Spiral-Memory
Copy link
Contributor

  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory
Copy link
Contributor

Apart from that, I understand the rest of the requirements, and I am fine with them.

@Nabhag8848
Copy link
Collaborator Author

Nabhag8848 commented Mar 6, 2024

  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

  • I do had this in mind, great to see you catched but wanted to make it little easy for first version, and iterate over the solution which we would have but lemme share that too.

  • For Solving the issue for the creation message may get old and may have lost already in rooms or the message has been pruned.

  • I have Two Solution ideas:

1

  • we can create /notion update command where we have dropdown to select the DB and once DB is selected, we need to lock the Modal to not have the DB Dropdown (similar to when DB is selected in Create Record) and we dynamically generate Dropdown to select the Record which needs to updated, each dropdown option would name as there primary property - Title ( the first property which is usually unique is also the page or record name). Selecting That Would now Get the Modal With Elements with default Value.

2

  • When a link for Database Record Has been shared, we can preview them with the fields - similar to ClickUp app video i shared, they are doing this - But this is little odd solution, its cool but we need to go to notion to get that link which is not so cool.

  • How should we approach ?

ps: this will make this feature more complex

@Nabhag8848 Nabhag8848 added the help wanted Extra attention is needed label Mar 6, 2024
@Spiral-Memory
Copy link
Contributor

Spiral-Memory commented Mar 8, 2024

Hey @Nabhag8848 , I have one doubt. Suppose I made a modal where we have the option to choose a database to update. Now, consider that the user chose that database. Next, we have to show another dropdown to choose from all the records. Once that is chosen, we will fetch all the values in that record and then provide an option to update it. Is that the correct flow, right?

I have added the code to choose till database, will start working on fetching records and populating the dropdown dynamically soon.

@Spiral-Memory
Copy link
Contributor

Spiral-Memory commented Mar 8, 2024

  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

  • I do had this in mind, great to see you catched but wanted to make it little easy for first version, and iterate over the solution which we would have but lemme share that too.
  • For Solving the issue for the creation message may get old and may have lost already in rooms or the message has been pruned.
  • I have Two Solution ideas:

1

  • we can create /notion update command where we have dropdown to select the DB and once DB is selected, we need to lock the Modal to not have the DB Dropdown (similar to when DB is selected in Create Record) and we dynamically generate Dropdown to select the Record which needs to updated, each dropdown option would name as there primary property - Title ( the first property which is usually unique is also the page or record name). Selecting That Would now Get the Modal With Elements with default Value.

2

  • When a link for Database Record Has been shared, we can preview them with the fields - similar to ClickUp app video i shared, they are doing this - But this is little odd solution, its cool but we need to go to notion to get that link which is not so cool.
  • How should we approach ?

ps: this will make this feature more complex

I think, I will prefer to go with approach 1 or maybe later to make it more accessible we can implement approach 2 sparingly

@Nabhag8848
Copy link
Collaborator Author

  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

  • I do had this in mind, great to see you catched but wanted to make it little easy for first version, and iterate over the solution which we would have but lemme share that too.
  • For Solving the issue for the creation message may get old and may have lost already in rooms or the message has been pruned.
  • I have Two Solution ideas:

1

  • we can create /notion update command where we have dropdown to select the DB and once DB is selected, we need to lock the Modal to not have the DB Dropdown (similar to when DB is selected in Create Record) and we dynamically generate Dropdown to select the Record which needs to updated, each dropdown option would name as there primary property - Title ( the first property which is usually unique is also the page or record name). Selecting That Would now Get the Modal With Elements with default Value.

2

  • When a link for Database Record Has been shared, we can preview them with the fields - similar to ClickUp app video i shared, they are doing this - But this is little odd solution, its cool but we need to go to notion to get that link which is not so cool.
  • How should we approach ?

ps: this will make this feature more complex

I think, I will prefer to go with approach 1 or maybe later to make it more accessible we can implement approach 2 sparingly

@Spiral-Memory can we have a first version without this complexity ? Just don't handle any of 2. Just have a message box action and open the modal having that record info directly with elements - No db and record selection.

  • We will Iterate Over after it, Lets divide into small chunks.

@Spiral-Memory
Copy link
Contributor

Spiral-Memory commented Mar 9, 2024

  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

  • I do had this in mind, great to see you catched but wanted to make it little easy for first version, and iterate over the solution which we would have but lemme share that too.
  • For Solving the issue for the creation message may get old and may have lost already in rooms or the message has been pruned.
  • I have Two Solution ideas:

1

  • we can create /notion update command where we have dropdown to select the DB and once DB is selected, we need to lock the Modal to not have the DB Dropdown (similar to when DB is selected in Create Record) and we dynamically generate Dropdown to select the Record which needs to updated, each dropdown option would name as there primary property - Title ( the first property which is usually unique is also the page or record name). Selecting That Would now Get the Modal With Elements with default Value.

2

  • When a link for Database Record Has been shared, we can preview them with the fields - similar to ClickUp app video i shared, they are doing this - But this is little odd solution, its cool but we need to go to notion to get that link which is not so cool.
  • How should we approach ?

ps: this will make this feature more complex

I think, I will prefer to go with approach 1 or maybe later to make it more accessible we can implement approach 2 sparingly

@Spiral-Memory can we have a first version without this complexity ? Just don't handle any of 2. Just have a message box action and open the modal having that record info directly with elements - No db and record selection.

  • We will Iterate Over after it, Lets divide into small chunks.

Actually @Nabhag8848 I have already made it till this point of selecting DB then updating that modal for record, it wasn't very complex.. Since we have time, I will go slowly and commit in the draft. Later we can do iterations to rather focus on improving it.

N no worries, I'm working in small chunks only 😃..

@Nabhag8848
Copy link
Collaborator Author

  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

  • I do had this in mind, great to see you catched but wanted to make it little easy for first version, and iterate over the solution which we would have but lemme share that too.
  • For Solving the issue for the creation message may get old and may have lost already in rooms or the message has been pruned.
  • I have Two Solution ideas:

1

  • we can create /notion update command where we have dropdown to select the DB and once DB is selected, we need to lock the Modal to not have the DB Dropdown (similar to when DB is selected in Create Record) and we dynamically generate Dropdown to select the Record which needs to updated, each dropdown option would name as there primary property - Title ( the first property which is usually unique is also the page or record name). Selecting That Would now Get the Modal With Elements with default Value.

2

  • When a link for Database Record Has been shared, we can preview them with the fields - similar to ClickUp app video i shared, they are doing this - But this is little odd solution, its cool but we need to go to notion to get that link which is not so cool.
  • How should we approach ?

ps: this will make this feature more complex

I think, I will prefer to go with approach 1 or maybe later to make it more accessible we can implement approach 2 sparingly

@Spiral-Memory can we have a first version without this complexity ? Just don't handle any of 2. Just have a message box action and open the modal having that record info directly with elements - No db and record selection.

  • We will Iterate Over after it, Lets divide into small chunks.

Actually @Nabhag8848 I have already made it till this point of selecting DB then updating that modal for record, it wasn't very complex.. Since we have time, I will go slowly and commit in the draft. Later we can do iterations to rather focus on improving it.

N no worries, I'm working in small chunks only 😃..

  • Cool Thats fine then, Make sure we also can include the support for that MessageBoxAction Support in few lines - using the same Modal Code, later.

@Spiral-Memory
Copy link
Contributor

Yes for sure ! 😃

@Spiral-Memory
Copy link
Contributor

Started working on this again ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Development

Successfully merging a pull request may close this issue.

2 participants