- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 12:43 PM
Hello,
We have recently received a new requirement from the business to give them a feature that allows them to build their own filter and set that value on a record. This will be in regards to the knowledge base application.
The reason they want this filter, is because they want to uniquely identify each record on the knowledge category table using a specific filter that will be tied to another custom table. This filter will act as a filter that they can then use to display to their end users through the portal.
Requirements:
- I need a UI Macro that will work very similaryly to the list view filter.
- The filter generated will need to be saved or passed to a field value on the form
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 02:23 PM
If I get your requirement correct, there is no need for UI macro if you are trying to add condition builders on an existing table's form.
You may create two fields:
1) One which allows you to pick a table name. "Table Name" type field.
2) And another field with field type as "Conditions". In the dictionary of the field you need to set table name field as dependency.
If you do this way, your business users should be able to form a filter in the UI and save it, and the field value will be saved as encoded query in the field in database.
You can use this field value, in whatever other places you like as needed.
You may want to set the table name field value to a default value and make it read-only or visible false if you do not want your users to edit it.
Please find ServiceNow OOB field types in here:
https://docs.servicenow.com/bundle/sandiego-platform-administration/page/administer/reference-pages/...
If you are trying to implement this in a UI page, you may find below article helpful.
https://community.servicenow.com/community?id=community_question&sys_id=141ea67bdbd5d454f7fca851ca96...
Please mark this as correct answer if this is helpful.
--
Thanks and regards,
Subrahmanyam Satti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 02:23 PM
If I get your requirement correct, there is no need for UI macro if you are trying to add condition builders on an existing table's form.
You may create two fields:
1) One which allows you to pick a table name. "Table Name" type field.
2) And another field with field type as "Conditions". In the dictionary of the field you need to set table name field as dependency.
If you do this way, your business users should be able to form a filter in the UI and save it, and the field value will be saved as encoded query in the field in database.
You can use this field value, in whatever other places you like as needed.
You may want to set the table name field value to a default value and make it read-only or visible false if you do not want your users to edit it.
Please find ServiceNow OOB field types in here:
https://docs.servicenow.com/bundle/sandiego-platform-administration/page/administer/reference-pages/...
If you are trying to implement this in a UI page, you may find below article helpful.
https://community.servicenow.com/community?id=community_question&sys_id=141ea67bdbd5d454f7fca851ca96...
Please mark this as correct answer if this is helpful.
--
Thanks and regards,
Subrahmanyam Satti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2022 09:02 AM