tsalb/lwc-utils

SOQL Datatable - Allow for custom action config in Screen Flows

solo-1234 opened this issue · 5 comments

Is there any way to show row-level actions in a soqldatatable in flow?

Use case: I have a page which shows my user a list of records (Soqldatatable on flexipage), and has a row level action and a couple of table actions. The row level action opens a flow in a modal and shows some more fields and info from the record.

I want the user to be able to choose a couple of options for filtering (eg: my records vs another user vs all / records where a date field = today vs all).

So I'm thinking to move it to a flow soqldatatable so I can give them controls for those filters, but it looks like I will lose the row level action. (I can use a buttons component to emulate the table actions.)

Wondering if there's a recommended approach for this. (Even better would be if the user didn't need to click the arrow button to access the actions, FWIW)

TY

tsalb commented

High level, this is not on the roadmap because of modal-ception.

That is not something I'm willing to tackle right now (the impact of introducing that).

For now, keeping this open (and changing title)!

Okay, thanks for letting me know.

Posting some of my thoughts on this in case they are helpful:

In regard to modal-ception, if I were building this (which I'm not) I would consider going the same route as this component:
https://unofficialsf.com/custom-flow-navigation-buttons-move-beyond-next-and-previous/

Summary: you provide a list of strings for button labels. When any button is clicked, the flow navigates to the next step (except if the button is named Previous), and the flow 'builder' needs to build a decision to look at which button was clicked and decide what to do next. That way there is no modal within a modal, instead, the button brings the user to another screen after which the admin can configure the flow to route back to the datatable (depending on the use case).

With that approach, the admin would only need to specify string labels for the table actions and/or the row actions, and then handle them as they wish. This avoids the need to create additional flows or configure anything in custom metadata.

tsalb commented

Fair approach, but I'm not really willing to take on such investment to support admin (apologies here) workflows.

With a developer, they can take my output variables (selected rows) and whip up their own LWC to consume it.

I'll take it into consideration but it would be significant refactoring to allow for a different code flow based on the context of which soqlDatatable is living in.

My suggestion here is to use a LWC to consume the selected rows in your own LWC on the next screen =D

I hear that! Meanwhile I can use that unofficialsf component to access selected rows and emulate table actions in flow, I just don't currently have a way to display a button on each row to emulate row actions.