A secret good flow builders know...

flows newsletter Aug 23, 2024

Have you ever used custom meta data?

Building your Flows to make long term maintenance easy is an excellent design principle (and custom metadata can help).

Let me tell you a story.

I have a client in the banking industry.

And I recently built them a screen flow that helps in their credit risk evaluation process.

It's big and complicated. There are 23 screens in the flow, one for each unique credit risk scenario.

Depending on the risk level of the loan, a bank employee using the Screen Flow is shown a list of up to four other bank employees who must review the loan information before it gets approved.

And with 23 credit scenarios, managing the reviewers for each one is complicated.

The reviewers change frequently. They swap roles.

And sometimes new reviewers get added.

The goal was to avoid having to update the flow (and all 23 screens) every time a reviewer changed.

Enter custom meta data.

By creating a custom meta type called "Review User", I was able to store all the review user information outside the flow.

Custom metadata is like it's own object.

You can create fields and then create records to store information.

In my case, I created a User_Id__c and a Role__c field.

Then I created a record for each reviewer.

This is great because now, in my flow, I can use a record collection drop down to query for users in this role (storing the User ID for later use)

That means I set the flow up once with a Record Choice collection and its ready forever.

All my Flow dropdowns will use this record choice collection, and they'll be dynamically kept up to date.

Adding users and changing roles is all done to the meta data records, rather than in the flow.

My client loved this because it makes future changes simple.

Other scenarios you could use custom metadata in include:

  • Discount Rules
  • Lead Scoring Criteria
  • Tax Rate Management

You get the idea.

We store compicated and changing information in metadata so that our flow doesn't have to be updated all the time.

The flow queries the metadata. And any changes we need to make are done on the metadata records.

Hope this helps!

 

Best,

 

Nick

 

P.S. Check out this YouTube video from me with a live example

https://youtu.be/7NxLsq8SQNM

Salesforce Saturdays

Join the Salesforce Saturday newsletter. Every Saturday, you'll get 1 actionable tip on Salesforce technology or career growth related to the Salesforce Industry.

We hate SPAM. We will never sell your information, for any reason.