Database view and Document ID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 01:22 PM
Hello all,
I have been scanning the community for all articles related to Document ID with the goal of obtaining the sys_id from that type of value. And it seems its not that simple. One suggestion in the following post was:
"I don't think you can get sysId directly of the record being referred by Document ID field....
you can try to create database view table and then export and then it might contain sysId"
I am trying that approach. Here is my database view:
So, I am trying to get all email attachments that were discarded. Then obtaining the email referenced in those. And obtaining the task (specifically Ticket) referenced in the email's 'instance' field (which is of Document ID type).
However no record is being returned and I have 101 records that satisfy the conditions. Can anyone see what is wrong here?
Also, this is very similar to the OOTB incident_metric one and that works fine:
Note: The mi_definition field is of type Document ID.
Appreciate any help.
Thanks,
Deb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 10:15 PM
Hello @dp11
Please change the variable prefix of sys_email_attachment table from emailAttach to emailattach. You will get the desired output.
Note: Don't use camel casing in database views
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2025 07:23 AM
Thanks for your reply. I changed to emailattach and still no output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2025 07:33 AM - edited ‎03-25-2025 07:33 AM
Hello @dp11
Now change the Where Clause for sys_email_attachment table like below:
emailattach_action='discarded'
It should work as it worked at my end
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2025 07:38 AM
OK, did that:
Still empty result:
And as you can see below I have 101 of such records: