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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Script List

(0) ShareShare
ReportReport
Posted on by 5

When fetching a list from the web and using it with a JavaScript script, it only returns the first text from the list instead of returning the complete list.

What a could i do?

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Bruno21 

     

    could you share the javascript code which you are using ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • Bruno21 Profile Picture
    5 on at

    var dates = [%List_date%];
    var min = dates[0];
    for(var i = 1; i < dates.length; i++) {
      if (fDate(dates[i]) > fDate(min))
        min = dates[i];
    }


    WScript.Echo(dates);

    function fDate(s) {
      var d = new Date();
      s = s.split('/');
      d.setFullYear(s[2]);
      d.setMonth(s[1]);
      d.setDate(s[0]);
      return d;
    }

    But from what it seemed to me, any list created previously by Power Automate doesn't fetch the entire list.

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You can only pass a simple string variable to a script from PAD, and anything returned by a script to PAD will also be a string. So, you need to work with strings and then build in processing for the string (such as splitting it into a list) into your script (if you want to pass it from PAD to a script) or in your PAD flow (if you want to return it from a script to your PAD flow).

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 132

Last 30 days Overall leaderboard