cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

Hello,

Does anyone know if its possible, and how to, view a Collection's contents using the browser Dev Tools when the app is in Play mode (not IDE Preview mode, but the same view the User sees)?

This would be very beneficial for me right now. 🙂

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

If you want it "right now", you can use the following expression in the debug console:

_rh4("<collection name>")

But this can change at any time (it's an internal implementation detail), so you shouldn't rely on it moving forward.

Just to be clear, I can't stress enough the last sentence: This is an internal implementation detail. This may change at any time, so don't make any long-term assumptions based on this.

Also, if you're in the JavaScript console, and you change the state of the app (purposely or not), you may change the behavior of the running app that may break it (only the instance that is running; if you close the browser and reopen the app, it will revert to the original app).

View solution in original post

10 REPLIES 10
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

If you want it "right now", you can use the following expression in the debug console:

_rh4("<collection name>")

But this can change at any time (it's an internal implementation detail), so you shouldn't rely on it moving forward.

Just to be clear, I can't stress enough the last sentence: This is an internal implementation detail. This may change at any time, so don't make any long-term assumptions based on this.

Also, if you're in the JavaScript console, and you change the state of the app (purposely or not), you may change the behavior of the running app that may break it (only the instance that is running; if you close the browser and reopen the app, it will revert to the original app).

View solution in original post

Super User
Super User

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

Hi @CarlosFigueira,

Wow, that's amazing!!! Thank you so much for this. I'm sure this will be such a great help for anyone who needs to carry out some debugging.

 

Super User
Super User

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

Hi @CarlosFigueira. Thank you for this nugget of info! I was able to execute the expression in the IDE Preview dev tools and view the collection contents.

Quick follow up question:

  • Being that this expression contains "AppAuthoringTool" is this expression specific to the IDE Preview?
    • If so, is there an equivalent expression for the AppViewer (user-facing app)?
Super User
Super User

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

For other rookies (like me) out there:

  1. CTRL+SHIFT+I (in Chrome) to open dev tools
  2. Click Console
  3. Paste in Carlos' expression substituting your collection name
  4. Hit Enter
  5. Click EXACTLY on the arrow to expand the list of items in the collection

colView1.png

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

The "authoring" part is just that the code was originally intended for the authoring piece, but it was then reused for the published app as well - it works for both. But to prevent this confusion, I edited the answer to show the shortcut that is used. I also added a very strong disclaimer that this may change at any time (it may not, but as this is an implementation detail, it may), so don't rely on that for production apps.

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

The "authoring" part is just that the code was originally intended for the authoring piece, but it was then reused for the published app as well - it works for both. But to prevent this confusion, I edited the answer to show the shortcut that is used. I also added a very strong disclaimer that this may change at any time (it may not, but as this is an implementation detail, it may), so don't rely on that for production apps.

Super User
Super User

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

Got it. Thanks for going that extra, extra mile! 🙂

iflyadesk
Level: Powered On

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

I see this easter egg is no longer at that location.  Where is it (or something like it) now?  Desperately need to troubleshoot an issue with a collection.

Genuinely,

Sam

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: JAVASCRIPT DEBUG: "See" Collection in Dev Tools?

Let me start with the disclaimer that this is not supported, may stop working at any time. Having said that, today you can use the function _rh4 to retrieve the values of a collection in the debugger console. If your collection is named 'mycoll', using _rh4("mycoll") in the console should give you the collection values.

Good luck 🙂

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 95 members 4,894 guests
Please welcome our newest community members: