Install and activate merTorchbug (addon for development help, inspection of variables ingame).
Open your collections, open the line of the stuff you want to inspect e.g. the companion or Giladil.
Move your mouse above the entry:
Type into chat: /tbm
or /tbug mouse
or use the keybind for it
At the inspection window click on the table: ... right if "__index" to see the data of the stuff underneath:
A new tab with the inspection values of that table opens, where you can see the data or dateEntry table:
Click on tha table of the dataEntry to see it contents.
Click on data there, then on dataSource and then you will see the source data of that entry at the UI:
At collectibleId you will find the number. Works for many collectibles that way.
10184