Hi all!
I have a table that has one editable column. This column is boolean (I make it as checkbox).
Are there any ways to make all rows 'true' at once (check all rows in this table)?
Now I am getting this boolean from {{table.changesetArray}}
Hi all!
I have a table that has one editable column. This column is boolean (I make it as checkbox).
Are there any ways to make all rows 'true' at once (check all rows in this table)?
Now I am getting this boolean from {{table.changesetArray}}
Welcome to the community @Minmin_Suzu! Thanks for contributing by asking a question.
I have a few ideas for accomplishing this but want to first ask some clarifying questions. Would you prefer that this single action behave as if a user had manually edited each cell in the column? Or is it okay if this single action actually modifies the records in your database before repopulating the table?
The former case is a little more challenging as the table's changesetArray
attribute is a read-only value and cannot be dynamically set. If that is your goal, however, you can build out a workaround by storing your fetched data in a global variable, set that variable as the data source for your table, and update the value of the variable via a button press and query. This would allow you to stage your changes as if manually editing the table and fire off a query to bulk update your database via a separate query.
The alternative is to write a query that simply bulk updates your database and refreshes the table with that newly updated data. We can then connect that query to a button and quickly approve every listed record.
It would also be good to know if you're working with paginated data, as that raises the question of which records to actually update - all of them or just the ones being currently shown.
Let me know how you want to proceed and I'd be happy to help you out!
Hi @Darren, thank you for suggesting this.
Replying to this thread as we are in the same boat, we need to help our users select all boxes first (boolean inside a column). The table could be as long as 1000+ rows, then users can review one more time and untick a few things before saving. We've tried to store the fetched data in a global variable but the users will make a few more changes before saving, so ideally we'd need a way to "select all" where it pushes all selected rows in a changeset ready for saving.
Is there another way to make that happen?
Thank you!
Hi @Jeje! Welcome back to the forums.
Unfortunately, I don't have any new updates here and the best workaround - as far as I'm aware - is still to perform all table edits on a global variable before saving to the database.
I had previously talked to our dev team about exposing a method for writing to a table's changsetArray
, but I'll kick off a more focused conversation given the specific interest in mass updating an editable boolean column. As always I'll provide updates here as I can!
This is great, thanks Darren!