Unfortunately, that linked answer is the way to do this strictly only using Flow. And, since you're interested in Description - you'll see that Description
is not part of RecordTypeLocalization so you don't have any option to do what you want only using Flow. I'll point out that, even if you were just interested in name - it would still be cumbersome to do as RecordTypeLocalization
has some big limitations that would add complexity just to get a list of record type names:
- This object only returns translated record types for that specific language. If you don't have a translation for the record type in that language - it won't be returned at all. For example, English wouldn't have any "translations" so this type of logic would only be for the non-default language.
- big pain with the
Get Record
element for RecordTypeLocalization
- you can't query by SObject
- can't query with the IN operation on
ParentId
(can upvote this idea and for reference, there is another unofficialsf package for this)
- "best" filter you can do is by language (which still goes against all SObjects) and could retrieve a lot of rows (and require a for loop and decision element to filter what you're interested in)
So you're left with calling an apex action to get this information.
There's an example from unofficialsf called Get Record Type Info By Object. This action would return the list of record type names which would be its UI labels (translated). You don't have to use that unlocked package as you can take a look at their source
The key is that RecordTypeInfo has a method, getName()
which handles giving you the UI label of the record type in Apex.
Returns the UI label of this record type. The label can be translated into any language that Salesforce supports.
However, there is no method to get the translated value of Description
(or any method to get the value of Description
). As such, you'll want to go at this a different way.
SOQL provides toLabel() which will make this Apex method pretty straightforward.
Use toLabel(fields) to translate SOQL query results into the user’s language.
A client application can have results from a query returned that are translated into the user’s language, using toLabel():
Some notes
- Returning a
List<List<RecordType>>
to facilitate using the output easily as a record collection variable.
- I did a query in a for loop because even though Flow passes a List - that list will be 1 if you're not passing a list of inputs. Depending on how you'd re-use this, you'd want to consider the scenario of more inputs (multiple objects, etc). This is just an example of how to do this
- You could take a look at the unofficialsf example for more inputs you may want to put (get default record type, ignore master, only get active) to add more functionality
@InvocableMethod
global static List<List<RecordType>> get(List<Requests> requestList){
List<List<RecordType>> recordTypeResponse = new List<List<RecordType>>();
for(Requests curRequest : requestList) {
List<RecordType> recordTypes = [SELECT Id, toLabel(Name), toLabel(Description) FROM RecordType WHERE SobjectType =: curRequest.objectName];
recordTypeResponse.add(recordTypes);
}
return recordTypeResponse;
global class Requests {
@InvocableVariable(label='Object Name' required=true)
global String objectName;
}
}
Then, in your Flow you could define the Name
or Description
as the value and that will display as translated when applicable.

