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 / Passing an array of st...
Power Automate
Unanswered

Passing an array of strings or DOM elements in Run Javascript as a Power Automate List Variable

(0) ShareShare
ReportReport
Posted on by

Hi,

I am trying to

(1) get to a website capture all the links of a particular pattern of id

(2) then pass those links to power automate and click through them one by one, and

(3) extract data from each of those pages

 

I am using Run Javascript and querySelectorAll to retrieve all links and store in a javascript array Features. This part (1) works.

I am unable to return this array to Power Automate as a list variable for step (2) an (3).

===================

function ExecuteScript() { 
    var Features = [];
    var features = document.querySelectorAll("a[id^='justResources_']");

    features.forEach(function(element){
        Features.push(element.id);
        //alert(element.id);
    });
    console.log(Features); // This works and shows all the ids
    return Features;
}

 

// Output variable from Run Javascript in PowerAutomate is %Features%

 

// In Power automate

for each %Feature% in %Features% loop .... complains that %Features% is [object Object].

==============================

 

At this point without understanding the interface between Run Javascript and Power Automate, I am hunting blind.

Any help is deeply appreciated.

 

Categories:
I have the same question (0)

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard