Apex Aide apexaide

Datatable with Row Actions calling a flow Action Button

By Eric Smith· ericsplayground.wordpress.com· ·Intermediate ·Admin ·3 min read
Summary

This solution demonstrates how to use a hidden Screen Action Button triggered by a row action within a custom Datatable in Salesforce Flow to reactively update records displayed on the screen. By leveraging reactive record collections, the flow updates selected Account records dynamically when users interact with row action buttons, modifying fields such as date and text formatting. It addresses the challenge of invoking subflows for record updates without direct user interaction on the button itself, enabling more seamless and reactive UI experiences. Salesforce teams can use this pattern to build more interactive and reactive flow screens with dynamic record updates and custom row actions.

Takeaways
  • Use hidden Screen Action buttons in Flows to trigger subflows from Datatable row actions.
  • Leverage Reactive Record Collections to maintain and update record collections dynamically.
  • Configure Datatable to restrict user action selection for controlled processing.
  • Use Upsert Record By Key component to reactively update records in the collection.
  • Modify flow XML to hide UI elements while maintaining functionality.

NOTE: (12/27/24) The Spring 25 release now allows you to attach the Action to the screen itself in addition to attching it to a button displayed on the screen. The screen action subflow will execute when the screen loads and whenever one of the input attributes to the flow changes. NOTE: (2/18/25) See this newer post for updated versions of this use case taking advantage of new features in Datatable and Flow Launcher. This use case for a "hidden Screen Action button shows how a row action in a custom Datatable can be used to execute a Screen Action subflow to reactively update the actioned record in the Datatable. The calling flow gets a collection of Account records and presents them on a reactive screen for user interaction. Heres the flow in action. Each time the row action button is clicked, that row gets updated by the Screen Action to set the date field to a month from the current date and change the text field to all uppercase. The flow screen has 5 components on it.

Flow BuilderUncategorizedFlowpower-automatereactivitySalesforcetechnology