Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Merging Data from two (or more) table into one table

imrane
Kilo Expert

Hi everyone,

I use [task_time_worked]   to track time worked on Incident and RITM

I want to make a report "group by company"

But Company is not at the same place for both tables :

  • In Incident : task_time_worked.task.Incident.CallerId.Company
  • In Sc Req Itm : task_time_worked.task.sc_req_item.request.requested_for.Company

What I want to achieve : Having a table that is like this

Created (from task_time_worked)
Time Worked
User (form task_time_worked)
Task TypeCompany (from incident AND req_item)
20/08/201715minIDEIncCust1
20/08/201715minIDEReq_ItemCust1

In other word, I think I want to make a Union where I can use a "AS Company"

Do you have any clue or advice ?

Thanks a lot

1 ACCEPTED SOLUTION

imrane
Kilo Expert

Hi everyone,



I finally gave up.



I used a "scripts - background" to fill "compagny" using rules listed above for all Incidents and Requested Item.


I used a Business Rule to fill "company" automatically



I can now report on task.company as wanted


View solution in original post

5 REPLIES 5

imrane
Kilo Expert

Hi everyone,



I finally gave up.



I used a "scripts - background" to fill "compagny" using rules listed above for all Incidents and Requested Item.


I used a Business Rule to fill "company" automatically



I can now report on task.company as wanted