I need a specific tip about app development on Bubble.
Let’s imagine that we have a one-page CRM. There is an INVOICE page that has 2 modes:
Creation of a new Invoice mode
Editing mode
That INVOICE page consists of several inputs and a button “SAVE”. When a user came for the first time, then it is mode #1. When the user selected a certain invoice in a table/list of invoices and came to the INVOICE page and each input displays info related to that certain invoice, then it is INVOICE mode. Tapping “SAVE” would make changes to that certain invoice instead of creating a new invoice.
Is there any other way to that without Local/Session storage? It is a bit tough to work with them because I have 1-3 actions per 1 storage element. I am not even sure that it is an okay approach to use in Bubble.
Or you can use the Invoice table to store a snapshot of the invoice pre-amendment.
Then on edit, set a status on the Invoice to “being edited” and then create a copy. Use autobind in edit mode. On “Save” (which is will probably what happens most of the time) turn the status back to “done”.
On “Cancel” instead, copy the data from the stored Invoice back over the top.
This then leaves the rare case of them quitting the app in the middle of an edit. Either ask them next time they go in to edit (like Word’s recovered document) or simpler just to copy the edits back.
The reverse of this (which doesn’t leave unsaved edits hanging around) is to create a new invoice from the old data with a status of “draft” and on “save” make that the live one.
The latter is a fairly good way of doing “new” as well. Create a skeleton invoice in draft mode then update the status when they want to create a new one. This does leave “draft” invoices hanging around but they can be cleaned up or left. Useful for getting an idea of how many times users quit in the middle of something. Which in my experience is a lot more often than you think