Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How to properly sort currencies in table

Issue

I am having trouble sorting my table widget in Appsmith, which pulls data from an MS SQL database view. I've tried using a numeric(15,2) and a float type, but the sorting is not working correctly and appears random. Additionally, I'm using a currency format to display the values in the table widget. Is there a way to display the proper format and also be able to sort by the value? Unfortunately, this feature is not yet available on Appsmith, but there is a feature request for it on GitHub.

Resolution

The user is facing an issue with sorting a table widget that pulls data from an MS SQL database view. They have tried using a numeric(15,2) and a float type, but the sorting is not working properly. The user has also added a currency format to the table column using {{new Intl.NumberFormat('en-US', {style: 'currency', currency: 'USD'}).format(currentRow["Amount"])}}, which further complicates the sorting issue.

Unfortunately, it seems that this feature is not yet supported by Appsmith. The user can add their use case to the existing feature request on GitHub to prioritize it in future updates.

As a workaround, the user can manipulate the data using a JS Object instead of directly querying the database in the table widget. However, this method requires storing the full data somewhere.