Filetering list by amount field in cents

Hi Forest.
I’m trying to do something but I’m not sure how to achieve the desired result. So I’m asking for your help to understand if I’m doing something wrong :slight_smile:

I have a collection with some fields. One of these fields is an amount which is stored in the DB in cents and it’s shown in forest accordingly (with the “price” widget Display widgets - Documentation).

Now, I want to filter the records in this collection, in order to find the items with a specific amount. As far as I can see, I need to input in the filter the amount in cents, matching the underlying data. Isn’t it?
How can I enable users to fill in the actual value? I mean, if the “logical” amount is 1234,56, in the database I have 123456 and 1234.56 is shown in the collection. I want the users to type in 1234.56 in the filter to match this item. But it looks like they have to type in 123456 in order to have a match.

How can I manage “price” items in the filters as well?
Thank you.
Matteo

Hi @Matteo,

Thank you for your feedback. I just checked on our end and you are right, filters only handle the “raw” values stored in database.

This is due to the price widget only being a visual asset used to improve price displays. It does not change the stored value, only the way it end up being displayed in the table list.

On the other hand, filters are designed to be used on stored values and are completely unaware of any defined widget, it just tells your backend to filter its own data with a list of filters.

Unfortunately, as is, we do not have a workaround for the usage you would need. I’m sorry about that. However, if that’s something you and your users really need, I can log it into our ProductBoard for future prioritization.

Best

1 Like

Thank you @lamatt_v
At the moment, I think we can go with the “workaround”, so I’ll tell my users to type in the “raw” value.

In a general perspective it would be nice to match the behaviour of filters and widgets.
So I’d really appreciate if you could register this feature request in your road map.

Thank you!
Matteo

1 Like