web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help Needed: Fetching ...
Power Automate
Suggested Answer

Help Needed: Fetching Console Data via Popup in Power Automate Desktop Flow

(0) ShareShare
ReportReport
Posted on by

Hello Everyone,
I’m creating a flow in Power Automate Desktop to test a webpage before deploying it to the production environment.

In this process, I need to fetch data from the Developer Tools (Console). Since I had trouble fetching the data directly from the Console, I created a popup box on the webpage through PAD. The flow captures all the data from the Console and places it into this popup box.
I was able to make this work for some of the buttons, but it isn’t working for a few others, as you can see in the screenshot. I’ve also attached the current flow in the screenshot for reference.

Please help me resolve this issue.

Below is the JavaScript code I used to create the popup box:


function () {
  // install once
  if (!window.__consoleTapInstalled) {
    window.__consoleTapInstalled = true;

    const stamp = () => new Date().toISOString();
    function ensurePanel() {
      let d = document.getElementById('console-log-capture');
      if (!d) {
        d = document.createElement('div');
        d.id = 'console-log-capture';
        d.style.cssText = [
          'position:fixed','bottom:10px','right:10px','width:560px','height:180px',
          'overflow:auto','background:#fff','color:#000','border:1px solid #666',
          'padding:6px','font:12px/1.3 monospace','z-index:2147483647'
        ].join(';');
        document.body.appendChild(d);
      }
      return d;
    }

    const push = (lvl, msg) => { ensurePanel().innerText += `[${stamp()}][${lvl}] ${msg}\n`; };
    const e0 = console.error, w0 = console.warn, l0 = console.log;
    console.error = function (...a) { push('ERROR', a.join(' ')); e0.apply(console, a); };
    console.warn  = function (...a) { push('WARN',  a.join(' ')); w0.apply(console, a); };
    console.log   = function (...a) { l0.apply(console, a); };
    window.addEventListener('error', e =>
      push('ERROR', (e.message||'') + (e.filename ? ` @ ${e.filename}:${e.lineno||''}` : ''))
    );
    window.addEventListener('unhandledrejection', e =>
      push('ERROR', `UnhandledRejection ${e.reason||''}`)
    );
    // self-heal if app re-renders
    window.__consoleTapEnsure = ensurePanel;
    setInterval(() => {
      try { if (!document.getElementById('console-log-capture')) ensurePanel(); } catch (_) {}
    }, 800);
  }

  // show & clear for this check
  const d = (window.__consoleTapEnsure && window.__consoleTapEnsure()) || document.getElementById('console-log-capture');
  if (d) { d.style.display = 'block'; d.innerText = ''; }
  return "ready";
}
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,206 Super User 2025 Season 2 on at
    Did you try extracting the console with "Extract data from window" -action? So not with Browser automation but with UI automation action.
    In my testing that seems to work well.



    Similar topic couple of weeks ago:
    https://community.powerplatform.com/forums/thread/details/?threadid=10c28f5b-be6d-f011-bec2-6045bddc3689

    That "Uncaught: SyntaxError_ Identifier 'req' has already..." -error might have happened before your script ran and that's why your javascript doesn't notice it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard