- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 09:23 AM
I am building a filter for a group of tasks in a custom table called u_account_project_tasks. There is a field called "State" in this table that is an integer value with associated display values for the front-end to make it easier for the user to identify in the portal. The filter is a drop-down where the user can select different fields (State, Assignment Group, Category, etc.) and then a search box to type in what State, group, etc. they want to filter for. The line I am struggling with is below:
if (input && input.searchKeyword !=null && input.taskFilterOptions == 'State') {
task_gr.addQuery('state.getDisplayValue()', "CONTAINS", input.searchKeyword.toString());
}
I want the user to be able to type in the state they want to filter for and then use that value to query the list.
Is there any way to get the display value of the State field inside the query?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 09:59 AM
Makes sense, Then Another way would be to first query the choice table to fetch the associated value field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 09:29 AM
Hi,
Cant you add if conditions like
var val = 0;
if(input.searchKeyword.toString() == 'Open')
val = 1;
else if (input.searchKeyword.toString() == 'Closed')
val = 3;
And at the end pass Val to the GlideRecord Query.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 09:53 AM
Yes, that is possible and I have thought f it as a backup solution. But there any several states and they could possibly change over time so I do not want to have to continue to add more logic for every possible input. It also does not allow for partial inputs. The user would have to type in the exact state display value to be able to search.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 09:59 AM
Makes sense, Then Another way would be to first query the choice table to fetch the associated value field.