Mobile application lookup(dropdown) values sorting
Hello
I need to sort lookup field by custom column for mobile application.
Is it possible ?
Like
Hi!
In the mobile app, lookups are sorted by the display value by default.
Sorting by a custom column isn’t available through the Mobile Wizard, but it is possible via customization using the Mobile SDK.
To do this, you’d need to:
- Set the sort order in the mobile list settings.
- Connect it via the Mobile Application Manifest.
Here are some helpful docs from Creatio Academy:
thanks but those links dont work
I need to sort lookup fields values on page, not the list
Hello, Tomasz,
Since you mentioned a different column in your question, let's clarify the point: Do you need to change the sorting of the values in the drop-down list (from smallest to largest, from A to Z) or do you need to filter the values in the drop-down list depending on the value of another field in the related entity?
It will be great if you can describe your task and provide any screenshots that will help us understand the task.
I need to change the sorting of the values in the drop-down list by newly added column to this drop down's lookup object
By default is by name or displany name, I addred numeric column for sorting to the lookup object, I need values to be sortet by this new column's value
Hello,
This can be implemented as expected. Please follow these steps to enable sorting for the lookup dropdown by a custom column:
Step 1 - Set the displayed value in the lookup object
Go to your Lookup object's settings and choose a custom Text-type column as the Displayed value, as shown below:
See example screenshot:
Please note: Creatio only allows fields of type Text to be used as a displayed value.
If needed, you can create a new Text column and populate it based on your logic.
Step 2 - Add sorting logic in the page's source code
In the viewModelConfigDiff section of your page schema, add the following configuration:
viewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[
{
"operation": "merge",
"path": [ "attributes" ],
"values": {
"ComboBox_YourComboBoxId_List": {
"modelConfig": {
"sortingConfig": {
"default": [
{
"columnName": "UsrMyCountText", // The field to sort by
"direction": "asc" // Use 'desc' for descending order
}
]
}
}
}
}
}
]
Replace ComboBox_YourComboBoxId_List with the actual ComboBox name from your viewConfigDiff.
This is the name of your dropdown field with _List suffix.