How can you filter using a Journal field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2016 10:47 AM
I have a journal field that I have added to my incident form. It is a journal field so it writes the value right under the field once it is saved. Another admin chose this field type and now I am being asked to report on this field. I want to pull a list of incidents where there is a value in this field. I can see it in my "Resolved" module as a column but I cannot use it as a filter condition in that list. It seems like Comments and Work Notes are the same. I would like to add a filter condition of MyJournalField IS NOT EMPTY however technically the field is empty after you save it but I see the value in the column in my list view when i add the column. I think this is the most recent value but that is ok. It would be helpful to be able to add a filter condition on any of them that says Journal field contains xyz or is not empty. I am on Eureka still fyi.
Can this be done or should I rewrite the form to have a string field on it instead like the description field to make my life easier?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2016 10:54 AM
The closest you will come is to select Keywords in the filter or "for text" in the Go To search. Global Text Search (top-right corner) may also yield results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 01:03 AM - edited 01-10-2024 01:04 AM
Hi ,
Journal filed filtering not working directly but you have to make some changes on URL to get result.
example: https://devxxxxx.service-now.com/sc_req_item_list.do?sysparm_query=work_notesLIKEtest
If any one the request work notes contains test keyword, it will display on list view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 01:07 AM
ServiceNow does not allow filtering on journal fields directly from the list view. This is because journal fields are designed to capture a history of entries, and each entry is stored as a separate record in a related list, not directly on the record itself. However, there are a few workarounds you can consider: 1. **Create a Scripted Filter**: You can create a scripted filter that checks if there are any entries in the journal field for each record. This would involve scripting and may require a good understanding of ServiceNow's scripting APIs. 2. **Use a Business Rule**: You can create a business rule that runs whenever a record is updated. This rule could check if the journal field has been updated, and if so, update a separate (non-journal) field on the record. You could then filter on this new field. 3. **Use a Reference Qualifier**: You can create a reference qualifier that checks if there are any entries in the journal field for each record. This would involve scripting and may require a good understanding of ServiceNow's scripting APIs. 4. **Use a Reporting Tool**: Some reporting tools, such as Performance Analytics, can report on journal fields. You could create a report that shows all records where the journal field is not empty. 5. **Change the Field Type**: As you suggested, changing the field type to a string field would allow you to filter directly on the field. However, this would lose the history of entries that a journal field provides. Remember, any changes to the system should be thoroughly tested in a non-production environment before being implemented in production.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 01:33 AM
ServiceNow does not allow filtering on journal fields directly from the list view. This is because journal fields are not stored in the same table as the record they are associated with. Instead, they are stored in a separate journal table (sys_journal_field), and each entry in a journal field is a separate record in this table. However, you can create a scripted filter to achieve this. Here are the steps: 1. Navigate to System Definition > Scripted Filters. 2. Click New to create a new scripted filter. 3. Fill in the necessary fields: - Name: Give your filter a name. - Table: Select the table you want to apply the filter to (e.g., Incident [incident]). - Script: Write a script that checks if the journal field is not empty. Here is a sample script: javascript var journalGR = new GlideRecord('sys_journal_field'); journalGR.addQuery('element_id', current.sys_id); journalGR.addQuery('element', 'your_journal_field_name'); journalGR.query(); return journalGR.hasNext(); 4. Click Submit to save the filter. Now, you can use this scripted filter in your list view to filter records where the journal field is not empty. Please note that this solution may have performance implications if you have a large number of records, as it needs to query the sys_journal_field table for each record. If performance is a concern, or if you frequently need to filter on this field, it might be better to change the field type to a string field. However, this would mean losing the journaling functionality (i.e., the ability to keep a history of changes to the field).