Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

how to create database view table on history and x table

Chindam Priyank
Tera Contributor

We have tried this way but no results.

table // order // prefix // where condition

x table //300 //fr // rl_id=fr_sys_id 
sys_history_line //200 // hl // hl_set=rl_sys_id 
sys_history_set // 100 // rl //
 
kindly assist
2 REPLIES 2

Sumanth16
Kilo Patron

Hi @Chindam Priyank ,

 

Please refer below thread:

 

https://www.servicenow.com/community/developer-forum/history-line-does-not-show-results-when-trying-...

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

Chindam Priyank
Tera Contributor

Hello,

My requirement is  : We want a report where we want know the ticket state to moved to "x" value and state is update last month to this "x" value.

 

So i am creating a db table by mergering metric definition, metric instance and my custom table. We have metric definition on task table on state field type is "field value duration". then create a report using "value= x and created = last month"

 

Below are my DB view conditions :

ChindamPriyank_0-1709279541644.png

 

metric_definition 100 md md_table = 'task' && md_field='state'


metric_instance 200 mi mi_definition = "metric definition sys_id" && mi_table="my custom table"

my custom table  300 fr mi_id=fr_sys_id  left join= true

 

this i am getting no records but total records count

ChindamPriyank_1-1709280421298.png

 

kindly suggest