When Winter ’23 release arrived, it brought with it Data Table and IN operator. I was excited to use them and wrote a blog on how it helped me solve a use case that was not possible to achieve with standard reports. I was happy with the 7 steps flow I created to achieve this
Now, a few releases later, Summer ‘23 is around the corner, and with it comes reactive screens and reactive formulas. I went back to my solution and was able to get the same result and reduce a 7 step flow to 1 screen. How awesome is that!!!
Reactive screens are currently in beta and you can try them out in a prerelease org running Summer ‘23 (don’t forget to opt in to the reactive screens beta under process automation settings in setup)
Here is how I did it
Reminder use case: display all open opportunities where the selected user is on the account team. Then display the account team role this user has for these accounts.
I used the new Data Fetcher component from Josh Dayment, and combined it with some complex SOQL queries that output the results into a Data Table.
To select the user, I added a lookup to the screen. This is currently the only reactive lookup element available. In order to get a list of users, you can point the component to any CreatedById lookup field from any object. I used the Account object.
My first formula (and make sure to use a formula resource, and not a variable or text template for this, as only formulas are reactive. Don’t ask me how I know 😉) queried the records for open opportunities
I fed this formula into the first data fetcher, and used a merge field to get the currently selected user from the screen.
The data fetcher queried records are displayed on screen using the Data Table component (Data Table is now GA, and also got some new enhancements in the summer release). The lookup component outputs the selected value and the selected label so I used another little formula to dynamically display the selected user name in the table title.
A similar process followed for the second table and showing the account team role
Look what I could achieve with just 4 formulas and one screen. Here is a demo of the finished flow and reactive functionality.
I can’t wait for this to be generally available to help us simplify multiple flows. For now this is only available in prerelease orgs and soon in sandboxes.