"Remove context row(s) from Model" want to do to the opposite

  • 1
  • Question
  • Updated 2 years ago
I am using the actions framework on a table with global actions.

For the global action, I'd like to select a few rows with the checkbox, and have all of the other rows removed from the model. I have used the "Remove context row(s) from Model" action, and it does the opposite of what I am after.

Any way to have an action where it is essentially, "Remove all rows, except context row(s), from Model"?
Photo of Sean

Sean

  • 630 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
This wouldn't be hard with a little javascript. Create an Id= multiple values condition on your model. Then, have your action run javascript that:
  • gets the Ids of the selected rows, 
  • creates a semicolon-separated string of them, 
  • activates and set's the value of your condition to that string, and 
  • query's the model 

(you could use the action framework for the query step if that's more comfortable for you).

This will help you get the selected rows: 
https://community.skuid.com/skuid/topics/javascript-for-rows-that-are-checked-in-a-table