The Winter ’23 release brings with it some very nice additions to flows. I set out to try out the new features with a use case that was impossible to do before without resorting to custom functionality
Use Case: Display all open opportunities for a selected user who is on the account team.
Problem statement: Since both opportunities and account team members are related to account, this cannot be done with standard reports. You cannot create a report type with one parent and two related objects.
I was able to accomplish this task using a flow combining some new features and some old favorites from UnofficialSF
The flow starts by displaying a user lookup for the selection. I had to use this custom lookup screen component since the standard one does not support a custom lookup field to a user record.
The selected UserId is then used to get all account team members for where the user is on the team
The next steps will be to get a collection of account Ids that can be used to get the open opportunities. For this I used the handy Extract Strings from Collection action instead of looping through the account team members and adding to a collection.
Now comes the fun part. I can use the new IN Operator to get all open opportunities where the opportunity’s account is in the account ID collection
I wanted to filter the account to get only the accounts that had open opportunities so I used another Extract Strings from Collection using the account Ids from the open opps. The dedupe function of the action ensures each account will only appear once in the resulting list (it is set to true by default)
Now that I had only the accounts of open opportunities, I wanted to filter my original account team members collection to only members from these accounts.
Alternatively you can use another get records IN, but this will consume another DML which can be avoided.
The next step was to prepare two more formula fields so I could display a link to the opportunity account name and the account name for the team member
Time to see the new Data Table (beta) in action
This is the open opportunities table
And the Account team table
Here is the completed flow
I added the flow to a Lightning app page and here is how the finished flow works
So simple and yet so powerful. I’m excited for all the new possibilities these new features bring to flow and looking forward to exploring more use cases.