Announcements
Using this script in power automate desktop to fetch details its producing variables new value[Object Obejct] but using same script in browser console its producing value
Hi @Joeanon ,
If you’re trying to return an object from a JavaScript function, you can use the JSON.stringify() function to convert the object into a string. For example, if JSONResponse is the object you’re trying to return, you can use JSON.stringify(JSONResponse)
(Note:- if you got your solution you can mark as solution and gives kudos)
Thanks & Regards
Vishnu Reddy
When i am saying object please find attached evidence i am getting this variable output while running script[Object Object] while running in Browser Console i am getting required data there
Hi @Joeanon !
Is it possible for you to provide the script here? Then we can figure out what is the issue.
function ExecuteScript() { var elements = document.getElementsByClassName("slds-popover__body"); var result = []; for (var i = 0; i < elements.length; i++) { result.push(elements[i].innerHTML); } return result.join("\n");}// Call the function and return the resultExecuteScript();
When using in 'Run JavaScript on Webpage' action, you don't need to call the function, ExecuteScript().
It will simply be this:
function ExecuteScript() { var elements = document.getElementsByClassName("slds-popover__body"); var result = []; for (var i = 0; i < elements.length; i++) { result.push(elements[i].innerHTML); } return result.join("\n"); }
I hope this helps.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
David_MA 258 Super User 2026 Season 2
trice602 198 Super User 2026 Season 2
11manish 136 Super User 2026 Season 2