Skip to main content
Nintex Community Menu Bar
Question

Code to run a table mass action from a button?

  • July 11, 2024
  • 10 replies
  • 1 view
  • Translate

Forum|alt.badge.img+8

Hi,

I have a mass action that when all of the rows on a table are selecting pops up and can be run.

Does anyone know if we can create a button that selects all then runs that mass action?

I assume javascript can do it but not sure where to start

This topic has been closed for comments

Forum|alt.badge.img+7
  • Nintex Employee
  • July 11, 2024

Just to make sure I understand, are you trying to run an action across all the rows in a model?

Translate

Forum|alt.badge.img+8

Yes. I can add as a mass action on the table (and have)… just wanted to attach it to a separate button

Translate

Forum|alt.badge.img+7
  • Nintex Employee
  • July 11, 2024

What does the action do?

Translate

Forum|alt.badge.img+8

triggers a salesforce flow

Translate

Forum|alt.badge.img+7
  • Nintex Employee
  • July 11, 2024

Did you want the button to only run the action on the rows the user has selected, or does it assume they want to run it on all the rows in the model?

Translate

Forum|alt.badge.img+8

all rows on model be good

Translate

Forum|alt.badge.img+7
  • Nintex Employee
  • July 11, 2024

Sweet, that’s actually easier to do than trying to figure out what the user had selected. The design is something like this:

  1. On your Model, add a UI only checkbox (I'll just refer to this as UI_Check)
  2. On your Model, add an action When row in model is updated. For the updated field select UI_Check. 
  3. In that model action, add the Data Source action.
  4. On your Button, add an action that Updates a field on a row. Select your Model and the field UICheck, and have it update all rows in the model.
That should do the job, however it'll only work once since the second try it'll be trying to check a box that's already checked. So on your button you will probably need to add a Branch so that it checks UI_Check if its unchecked, and unchecks it if it is already checked.
Translate

Forum|alt.badge.img+8

Fantastic work around!

Thanks Matt

Translate

Forum|alt.badge.img+7
  • Nintex Employee
  • July 11, 2024

No problem, hope it works out

Translate

Forum|alt.badge.img+8

Working on modifying this action framework for transferring all row data between models. But it seems like Model-based actions wont’t recognize the row context and instead replicates the first row’s information. 

Safe to assume I’m going to have to use a snippet to properly transfer each row’s information to my destination model? The use case is transferring all OpportunityLineItem rows into our Datasource model so we can post to an external data source. 

Translate

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings