Bulk Update selected rows with value #11055
-
I am trying to select multiple rows, press a button which then prompts me for a value. After I have entered the value, this value should be saved back to a specific column in the table. So in this example I would like to change the "Estimated Sales" to 30. So I would want to select both rows, the Button should prompt me for a value and after I entered 30 and clicked save, the value of "Estimated Sales" should change to 30 This is a similar open Issue: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
Hey @Blochergroup, I believe in this instance you could use automations for this along with the automation app action. I've created a simple demo below to help guide you on how to do this.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() ![]() I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
I've come up with a new solution that should work well for you both. It's similar to Conor's method above but instead of querying the rows in the automation, I am passing an array of full row objects to the automation from the data provider. I am using a Postgres table to test this so it should work with most other external datasources. In order to access that full row data I have made sure that the update button where I'm triggering the automation is nested within the data provider as shown here: Here are the actions I have for the button: Here is the custom JS I am using to get the value for rows: return $("Dataprovider.Rows").filter(x => $("Table.Selected rows").includes(x._id)); This returns an array of the full row objects for the ids that are selected in the table. Now that we are passing the full objects to the array we can reduce the complexity of the automation. Here are the updated automation steps: For the trigger values I am making sure that Then I have an Update Row step which loops over the Finally I have a Collect Data step at the end of my automation. This is not necessary for the basic functionality of this but is a nice bonus as it allows my automation to run synchronously. This means that the Refresh Data Provider action on the update button on my screen will only run after my automation has finished updating the table. |
Beta Was this translation helpful? Give feedback.
-
*** EDIT *** Hi All, sorry to reopen this thread after so long, but I didn't have the opportunity to test this solution earlier due to a variety of reasons (both professional and personal). So, long story short, it still does not work for me. But this time the problem is different in my case. Implementing the solution suggested by @andz-bb I managed to correctly pass the selected rows to the automation, but for some reason I can't understand, the loop block in the automation receives an empty input and exits with "no iterations". This is how I modified my automation, as per @andz-bb instructions: Here is the log of the automation execution as seen from the "manage" section of my app, as you can see the output of the trigger block correctly contains the array of the selected rows, but the input to the looping block is empty so no rows are actually updated: I'm stuck at this point and I am unsure what to do next. Maybe I should delete and re-create the automation? The app is updated to the latest version (2.9.25), and the backend database is MariaDB (but considering the automation logs I don't think that the backend is relevant for the problem I'm experiencing). |
Beta Was this translation helpful? Give feedback.
-
Hello, I followed the automation update guide above and I succeeded, but I have problems with relationship typed columns. My automation trigger updates boolean fields "Approved" from false to true, as intended. But updates relationship field "Workers" to empty as well, although the checkbox "Clear relationships if empty?" is not checked. Seems to me like a bug. Can anyone work it around? (PostgresDB, latest docker image) |
Beta Was this translation helpful? Give feedback.
hey @Blochergroup @sklaffa
I've come up with a new solution that should work well for you both. It's similar to Conor's method above but instead of querying the rows in the automation, I am passing an array of full row objects to the automation from the data provider. I am using a Postgres table to test this so it should work with most other external datasources.
In order to access that full row data I have made sure that the update button where I'm triggering the automation is nested within the data provider as shown here:
Here are the actions I have for the button:
Here is the custom JS I am using to get the value for rows: