How can I pass the magic "i" value from action button to query?

I have action buttons in the last column of the table and when I click on it executes the JS code below:


I want to somehow pass the magic "I" to the queries and use them like this:

	JOIN customers ON = accounts.customer_id
WHERE = {{[i].id }};

I need to access the "id" field from the table where the action button belongs.

How can I pass the value to the query?

Hi @ckissi!

You’d want to use the additionalScope option in the trigger method to pass in the i or the[i].id value. That would look like this:

line_items.trigger( {
additionalScope: {i:i} 
} );

There’s some more info and examples on that here:

1 Like