cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

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
CarlosFigueira
Power Apps
Power Apps

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
CarlosFigueira
Power Apps
Power Apps

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

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.

 

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)?

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

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.

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.

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

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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (53,160)