Clearing data off a page

I have a page dedicated to creating new invoices. However, after I hit the save button, I need all the input fields and tables to reset, allowing me to begin a new invoice from scratch. Presently, whenever I revisit the page, it retains all the data from the previous invoice I was working on.

Still haven’t figured this out. I tried to reset data and reset inputs. Both didn’t work.

What’s the data source of the page / group? I’m positive it’s data type is set to invoice and is searching for the last invoice created.

Your elements / inputs are referencing to the parent group’s invoice so even if you reset the data or reset inputs, it would just reset the values to the parent group’s invoice data

Page type content is invoice. How can I fix this?

If you want the inputs and data to be empty on page load and create an invoice only when you click “send an invoice”, you would need to remove its data source.

Doing this would complicate some of your logic though since you have a dynamic RG for the payment scheduler and list of items. Every time you would add a payment and item, you won’t be able to reference to an invoice since, well, you haven’t created one yet.

You would need to do some workarounds to make the dynamic RG work on a page / group that don’t have a data type. Increasing the number of cells dynamically is the easy part. The tricky part is saving each cell to the DB. You would need to either use plugins like Orchestra or do it natively using @artemzheg’s awesome tip Dynamic row addition in Repeating Group and bulk CRUD of Things using vanilla Bubble

Hope this helps

The data source for the two tables are not invoice. Item table is “invoice items” and the payment scheduler is “payments”.

Yes, I know. I meant the parent group / page. You can only link the payments and invoice items to the invoice using either lists or having an invoice field to these two data types. Either way, you would still need to create an invoice first.

Now, if you won’t be creating an invoice yet, it wouldn’t make sense to create invoice items and payments right when you click “add items” or “add payment” since if a user won’t click create an invoice or something, you would be left with useless invoice items and payments data.

Ideally, you want to create the data when you’re completely finished with the invoice.