- Catalog Items and Record Producer usage is stored in two different tables
- Catalog Items: sc_req_item
- Record Producers: sc_item_produced_record
- We need to merge the data from both tables and show it in a Report
Let’s combine two cool features from recent releases:
Create a new remote table (System Definition → Remote Tables → Tables) and add fields: Name, Type, Count
Create remote table definition (System Definition → Remote Tables → Definitions) and set the cache to 1 hour (3600 seconds). We don’t need real-time data.
This is the data in the temporary data in our new remote table.
Finally, we just need to use this data to create a nice report.
Group by: name
Aggregation: Sum → Request count
- “Remote table” is a confusing name. Data doesn’t need to be remote, you can get it from the same instance.
- We all should start getting used to GlideQuery. It takes some time to make the switch from GlideRecord and GlideAggregate, but it is worth it.