In Dynamics 365 / Power Apps, entity names can have various different plural extensions, such as “s”, “es”, “ies” etc. So when you’re writing code and you need the plural name of an entity dynamically, knowing only the singular name, how do you get it to ensuring you’re using the right name?
You can use Xrm.Utility.getEntityMetadata to get it. For example, with accounts below:
Xrm.Utility.getEntityMetadata("accounts", "")
.then(function (result) {
console.log("Entity Set Name: " + result.EntitySetName);
}, function (error) {
console.log(error);
});This produces:

A more interesting example, let’s say you have an entity called adobe_integrationsettings which may be installed. Note this name is already plural, though it is the logical name. Running this:

Returns a less obvious adobe_integrationsettingses.
GETTING PLURAL NAMES OF ENTITIES USING WEBAPI
Here is the another method to get the Plural name of the enntities
// Get plural names (EntitySetNames) for all entities
var req = new XMLHttpRequest();
req.open(
"GET",
Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.2/EntityDefinitions?$select=LogicalName,EntitySetName",
true
);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var results = JSON.parse(this.response);
results.value.forEach(function (entity) {
console.log("Logical Name: " + entity.LogicalName + " | EntitySetName: " + entity.EntitySetName);
});
} else {
console.error("Error retrieving entity definitions:", this.statusText);
}
}
};
req.send();
GETTING PLURAL NAMES OF ENTITIES USING WEBAPI
