While not usually a best practice, sometimes you need to rename standard objects.
Depending on whether the object is standard, custom, or part of a package, the exact renaming process takes a few shapes.
However once renamed, you may need to retrieve the new label to display in a screen flow. For example, if Contact was renamed to “Person”, then you wouldn’t want the word “contact” to appear in a screen flow, since that wouldn’t reflect the word used.
There are two ways to get the new label:
1. In flow
Get the object called EntityDefinition, where QualifiedApiName = {API name of the object} (e.g. “Contact”Then the field Label stored the singular label, while PluralLabel stored the plural label.
2. In apex
String objectApiName = 'Contact'; SObjectType objType = Schema.getGlobalDescribe().get(objectApiName); String label = objType.getDescribe().getLabel();
This code can be placed in an invocable apex class, so it can be used via flow.
The takeaway
When an object is renamed, be careful to stay consistent with the new label.