davhad
davhad3y ago

Update a field value for all rows

Hey everyone, was wondering if anyone knows if the new version update now has an option to update all fields of a certain column at once.
5 Replies
seenee
seenee3y ago
Hi, this isn't part of the update. Could you please tell us more about your use case for this?
davhad
davhad3y ago
Hi there, i's something I've already discussed with Shams. Let me share it here: You know when you are in a spreadsheet, click on a cell and drag the value al the way down to the last row? You updated all row values for that column. Same for Airtable. I'm unsure how to do that with Rowy. If you want to update all fields of a column or some of them in batch. This is useful for: 1. Batch editing. 2. Post-filling values after a new column has been created. 3. Feature already commonly used in Airtable Google spreadsheets etc. Does it make more sense now?
seenee
seenee3y ago
Thanks for this, we’ll take this into consideration.
davhad
davhad3y ago
Thanks. Curious what workarounds there are at the moment as it's an actual need that I have right now.
Shams
Shams3y ago
hey @davhad, you mainly need to run the following if you have a node environment with firebase admin sdk setup
const collection = await db.collection(collectionPath).get()
collection.docs.forEach((doc)=>doc.ref.update({[fieldKey]:value}))
const collection = await db.collection(collectionPath).get()
collection.docs.forEach((doc)=>doc.ref.update({[fieldKey]:value}))
another work around is if you create temporary table, where you can add an action script for the above code that you can run