I’m in the process of developing an invoicing app on Bubble.
Here is what I have set up and working:
- Display a list of ‘line_items’ in a RG (Repeating Group).
- If the user wants to change a line_item, they can click EDIT enabling the inputs to be edited via custom states within the cell.
- After changes are made, the user hits SAVE (within the cell) to trigger a workflow to update the current cell’s line_item.
Here’s what I’m trying to achieve:
- Load line_items in the RG (all will be editable).
- Users can edit details of these line items (quantity, cost, etc.). However, crucially, these changes should be temporary and not immediately reflect in the database.
- Batch Update: Once the user has made all their desired edits, they would click a SAVE button. Only then should all the changes they’ve made be batch-saved to the database, updating all the affected records.
I keep getting hung up accessing data within the RG. Has anyone implemented a similar feature or have ideas on how best to approach this? Your advice and suggestions would be greatly appreciated!
Thank you in advance for your help.
Wouldn’t loading the data into a custom state and referencing those records in the RG instead of referencing the data directly prevent any edits from being saved to DB?
Of course tracking changes to save upon button click can be tedious…
From what I can gather, as long as the SAVE button lives within the RG cell (regardless of the data source) you can access/edit the record.
Currently, I have the EDIT/SAVE button in each RG cell, which then runs the workflow to update the current cells record. That is working.
Once you leave the cell, I can’t seem to access any data within the RG cells.
Any changes made can live in the input field itself.
It’s all about the data source. How are you saving changes to the DB when a user clicks save?
I believe Bubble recognizes the input is within the Cell. Again, I can’t access “Input cost’s value” from a workflow initiated outside of a RG Cell.
You are linking the DB record to the cell.
What happens when a user clicks edit? whats the WF to make the line editable?
I’m using a combo of a custom state (yes/no) on a group within the Cell and a conditional on the input.