Sort Order parameter for Dynamics 365 API call
I am using AEM Forms and connecting form elements to Microsoft Dynamics 365.
I use the Form Data Model to create API endpoints to connect with the specific Dynamics 365 entities I am interested in.
The problem I am facing is that the data returned from a Dynamics 365 entity is not in the order I require. The data coming back has a default sort order by created date; I need the data sorted alphabetically to populate a drop-down list.
The APIs in Microsoft Dynamics 365 allow for an Order By parameter; however, I do not know how to specify the Order By parameter in the Form Data Model API. The Form Data Model API allows for a filtering parameter but I cannot seem to get an Order By parameter to work.
Below is some JavaScript used to bind the API endpoint to a drop-down list.
var operationInfo = {
"formDataModelId": "/content/dam/formsanddocuments-fdm/ms-dynamics-fdm",
"operationTitle": "GET account /accounts",
"operationName": "GET account /accounts_15209302043150"
};
var inputs = {
"isinstitution": true
};
var outputs={
savedValue:'accountid',
displayedValue:'name',
field:this
};
guidelib.dataIntegrationUtils.setOptionsFromService(operationInfo, inputs, outputs);
It doesn't appear that the 'var inputs' allows for an Order By parameter either.
How can I add an Order By parameter to the Microsoft Dynamics 365 API in the Form Data Model or when binding the drop-down list?