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

Javascript using PAD?

(0) ShareShare
ReportReport
Posted on by 14

What I am currently doing is to initialize arrays and store multiple strings in it, then put the arrays in a list.

 

var US_COTTON = ["US_COTTON.csv", "US COTTON", "USDCents/LB", "USA", "D"];
var INDIA_COTTON = ["INDIA_COTTON.csv", "INDIA COTTON", "USDCents/LB", "INDIA", "D"];

var list = new Array();
list.push(US_COTTON);
list.push(INDIA_COTTON);

WScript.Echo(list);

 

The above code is what I currently wrote, and it creates a variable called %Result&

 

However, when I use %Result% outside of the Javascript, for example, if I do %Result[0][0]%, it does not print "US_COTTON.csv", but rather print out a Character, 'U'.

 

Does anyone know what I am missing here?

 

Thanks in advance!

  • Verified answer
    VJR Profile Picture
    7,635 on at

    The %Result% is an output variable of "Run javascript on webpage" action, unless you manually changed it.

     

    I ran your script on "Run Javascript" action and it gave me the below output.

    VJR_0-1648782382266.png

     

  • yscx523194 Profile Picture
    14 on at

    So what I need is that if I run %Result[0][0]%, than I need to get "US_COTTON.csv"

  • VJR Profile Picture
    7,635 on at

    The JavascriptOutput variable in this case is not a Datatable.

    So you won't get it as the way you have pointed out.

     

    It is a TextValue as shown in above screenshot.

    You can split it by comma and then %OutputVariableName[0]% will give you the first item.

     

    VJR_0-1648789705498.png

     

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 229 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 223 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 136 Super User 2026 Season 2

Last 30 days Overall leaderboard