Task: Add the ability to search by keywords on the "Add relation task - asset" or "Add assets" widget, by clicking the magnifying glass icon, as implemented on the standard table.
Hello!
To implement this customization of the ITAM asset addition widget, you will need to create a custom copy of the widget and implement the required change by adding a control for entering keywords and substituting them into queries against the asset table (itam_asset) as an additional condition of the form assetSr.addEncodedQuery('keywordsAREServer equipment');.
Example of using an encoded query in a server script:
const assetSr = new SimpleRecord('itam_asset');
assetSr.addEncodedQuery('keywordsAREServer equipment');
assetSr.query();
ss.info(assetSr.getRowCount());
Example of using an encoded query with the REST TABLE API (used in the widget’s client script fetchData() function):
/rest/v1/table/itam_asset?sysparm_query=keywordsServer equipment
I have tested it — it works.
Please note that, out of the box, full-text search is enabled only for two fields in the itam_asset table: Part Number and Inventory Number. You may need to activate full-text search for additional fields according to your custom scenario. After enabling full-text search on a field, you must reindex the table (only once after each activation of full-text search on a field, can be done in bulk): simply run the server script /record/sys_script/172010221518000015 during off-hours.
If you would like full-text search to be available out-of-the-box in the ITAM asset addition widget, I recommend submitting a PIR.
Best regards, Nikita
Is there already a ready-made implementation of an input and value search element in other widgets "out of the box"?
In ITAM 1.2.5, there is a self-service portal page that displays the list of assets for the current user, featuring a keyword search implemented using the built-in ListItem widget with the simple-tag listitems. < Keep an eye on this page, as each platform version introduces more and more new simple-tags. The ITAM team integrates new ones as they are released, according to priority and availability.
The list of the current user’s assets on the self-service portal (with built-in keyword search) is located here: /portal/my_itam_assets
(Requires ITAM version 1.2.5 or higher)
Best regards, Nikita
Hello! I took a closer look at the widget for adding assets to ITAM tasks —
keyword search is already available. In the filter, you need to select “Keywords” contains…
Please note that, out of the box, full-text search indexes only two fields from the itam_asset table: Part Number and Inventory Number. You may need to enable full-text search for additional fields according to your custom scenario.
As for the “quick search” (when clicking the magnifying glass under a column in the traditional list in the agent interface)
we will be working on enhancing the widget for adding assets to ITAM tasks and the widget for adding requirement lines to purchase orders in the medium term, once the new Simpl-Tags platform package is released, to implement everything using platform-native tools.
Best regards, Nikita


