How to get unselected rows from a Salesforce Flow data table
How to Get Unselected Rows from a Data Table in Salesforce Flows
When working with Salesforce Flows, data tables offer a powerful way to let users select and manipulate records. However, there are scenarios where you need to identify rows that were not selected by the user. This might seem tricky at first, but with the right approach, it’s simple and effective.
In this article, we’ll walk through how to achieve this step-by-step, ensuring your flow is robust and efficient.
Why Identify Unselected Rows?
Understanding unselected rows can be crucial for use cases such as:
- Sending follow-up emails to users who didn’t meet a specific condition.
- Assigning unselected tasks to a backup team.
- Auditing records to confirm actions were taken only on selected data.
By automating this in Salesforce Flows, you save time and reduce human error.
Step-by-Step Guide: Getting Unselected Rows
Step 1: Create a Collection of All Records
In your flow, start by pulling all relevant records into a collection using a Get Records
element. This will serve as your baseline data set.
Use a transform element to collect the Ids of all rows.
Step 2: Add the Data Table
Use a Screen Flow to display the records in a data table. Make sure users can select multiple rows, as this is where they’ll make their choices.
Step 3: Capture Selected Rows IDs
Store the selected rows IDs in a text collection variable. Salesforce’s data table has an output "Selected Rows", using a transform element, we can extract the selected rows Ids.
Step 4: Compare Collections
To identify unselected rows, compare the full collection from Step 1 against the collection of selected rows Ids from step 3. Use a Loop
element to iterate through the full collection, then use a Decision
element to check if current item is already selected, if not, use an assignment
element to add it to a new collection that will contain the unselected rows.
Step 5: Build a Collection of Unselected Rows
For every record that doesn’t exist in the selected rows collection, add it to a new collection variable. This will represent your unselected rows.
Step 6: Use the Unselected Rows
You can now use this collection for any action, such as updates, notifications, or logging.
Free Courses and Awesome Resources
- FREE Salesforce Nonprofit Cloud Fundraising Implementation Course: Watch on YouTube and start mastering Nonprofit Cloud solutions tailored for your organization.
- FREE Salesforce Flow Course: Start Learning Now to build powerful automations and improve your Salesforce skills.
- YouTube Channel: Subscribe to Swift Cloud Solutions for expert insights and tutorials on Salesforce Flows and Nonprofit Cloud strategies.
- Stay Updated: Join My Newsletter and never miss valuable tips and updates.
- Connect on LinkedIn: Follow Me for professional updates and Salesforce content.
- Need to speak with a Salesforce Consultant? Schedule a time with me here
Enhance your fundraising strategy
Think about real-time insights that allow you to act swiftly, faster than ever before. Imagine a solution that enhances donor engagement, galvanizing your fundraising strategy.
How to get Salesforce Nonprofit Cloud 10 Free Licenses
You can get a Free Salesforce Nonprofit Cloud instance with 10 Free Licenses, here is how