Multi-select records from a section list and passing to a BP
Now that lists have a multi-select feature, how can one access the DataTable_SelectionState for that list and pass it to a BP? The available button actions don't seem to have an option specific to sections and I'm not yet seeing any samples out there on how to do it in code.
Has anyone tackled this yet?
Like
Hi Jeremy!
You can use the following in a request handler for the action buttons for the list - this will return an array of the selected Id values:
const selectedIds = (await request.$context.DataTable_SelectionState).selected; // selectedIds will be an array of Id's for any selected records
As for getting them to a process, you could pass in as a string to a param or execute the process separately for each Id. See here for executing a process, if needed.
More info here: https://customerfx.com/article/getting-multi-select-records-from-a-crea…
Ryan
Hi Jeremy!
You can use the following in a request handler for the action buttons for the list - this will return an array of the selected Id values:
const selectedIds = (await request.$context.DataTable_SelectionState).selected; // selectedIds will be an array of Id's for any selected records
As for getting them to a process, you could pass in as a string to a param or execute the process separately for each Id. See here for executing a process, if needed.
More info here: https://customerfx.com/article/getting-multi-select-records-from-a-crea…
Ryan
Ryan Farley,
This is exactly what I was looking for. Thanks Ryan!