Console.table() - A Better Way to Debug using your Browser Console

  • 11
  • Praise
  • Updated 1 year ago
Many of us are familiar with using console commands such as 
skuid.$M('ModelName');


I recently discovered that we can use console.table()... Enjoy! :)

console.table(skuid.$M('ModelName').data);
Returns the data in a model

console.table(skuid.$M('ModelName').data, ['Id', 'Name', 'Status__c']);
Returns the data for specific fields in a model

console.table(skuid.$M('ModelName').fields);
Returns the properties of all the fields in a model

console.table(skuid.$M('ModelName').conditions);
Returns the properties of all the conditions in a model

console.table(skuid.model.getModelsList());
Returns a list of all Models

console.table(skuid.model.getModelsList(), ['id', 'objectName', 'recordsLimit', 'canRetrieveMoreRows', 'orderByClause']);
Returns a list of all Models with specific Model properties selected


...
And the best part is, any of these tables can be dynamically ordered!


Photo of mB Roman Melnik

mB Roman Melnik

  • 2,802 Points 2k badge 2x thumb

Posted 2 years ago

  • 11
Photo of mB Roman Melnik

mB Roman Melnik

  • 2,802 Points 2k badge 2x thumb
Shout out to Stephen Sells for inspiring this post. Some more useful Console Commands can be found at his post here.
(Edited)
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,776 Points 10k badge 2x thumb
Thank you. Thank you. Thank you very much.
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Roman,

This is cool!

Thanks!

Bill
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
Very very cool!
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Cool! Thanks
Photo of Royston Goveia

Royston Goveia

  • 424 Points 250 badge 2x thumb
nice touch! 
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
All,

A link to Mozilla's document page about 'console':

https://developer.mozilla.org/en-US/docs/Web/API/Console

Thanks again Roman!

Bill
Photo of mB Roman Melnik

mB Roman Melnik

  • 2,802 Points 2k badge 2x thumb
Thanks Bill! Upon discovery, I knew this would become an invaluable tool for many of us here.

Personally, I never enjoyed calling skuid.$M('ModelName'); and then needing to drill down manually to 2 or 3 more levels to get the info I was actually looking for.

console.table() makes it so much easier to visually grasp.
Photo of Joseph Ortiz

Joseph Ortiz

  • 594 Points 500 badge 2x thumb
I love this post.
Photo of John Nelson

John Nelson, Product Manager

  • 3,204 Points 3k badge 2x thumb
Agreed. Very cool find.