How to filter Objects entry with picklist's name in filter
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
-
I have created 2 picklists, e.g. picklist1 and picklist2. And I created 1 object where I create 2 fields of type picklist and I mapped this to above picklists. Now I have added an object entry.
Picklist values are stored as {"key": "demo", "name": "Demo"}. Now when I try to apply filter picklist1.name eq 'Demo', it doesn't work.
Kindly help on how I can achieve this.
Resolution
- Presently, you can search and filter entries using Picklist keys, though not labels.
-
For now, search and filter works for Picklist considering the key of it.So, let's suppose we have a Picklist called country and a Picklist Item with brazil as key and Italy as label.
If we filter with country eq 'brazil', we'll have the entry in the response. If we filter with country eq 'Italy' , the entry won't come in the response.
-
In other words, the problem might be that you are filtering by name, not by key.
Did this article resolve your issue ?