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 Platform Community / Forums / Power Automate / Help with multi-line s...
Power Automate
Answered

Help with multi-line strings in variables and executing JS in the browser

(0) ShareShare
ReportReport
Posted on by 398

Hi all, I'm new to the platform, got it running on March 4. I am pleased with results so far.

For the RPA Challenge (Input Forms) I got the following result

 

RPA ChallengeRPA Challenge

but it was torture minifying the JS to put in the ExecuteScript function in Firefox.

In the freeware, downloadable version Robin (the scripting language Softomotive developed before MS bought them out), whose successor apparently powers PAD, you can write multiline variables like so:

 

 

 

loop i from 0 to 9

 set js to js + """
 m = document.querySelector('input[ng-reflect-name="labelEmail"]');
 m.value = '""" + emailList[i] + """';
 a = document.querySelector('input[ng-reflect-name="labelAddress"]');
 a.value = '""" + addressList[i] + """';
 f = document.querySelector('input[ng-reflect-name="labelFirstName"]');
 f.value = '""" + firstNameList[i] + """';
 l = document.querySelector('input[ng-reflect-name="labelLastName"]');
 l.value = '""" + lastNameList[i] + """';
 p = document.querySelector('input[ng-reflect-name="labelPhone"]');
 p.value = '""" + phoneList[i] + """';
 r = document.querySelector('input[ng-reflect-name="labelRole"]');
 r.value = '""" + roleList[i] + """';
 c = document.querySelector('input[ng-reflect-name="labelCompanyName"]');
 c.value = '""" + companyNameList[i] + """';
 s = document.querySelector('input[value="Submit"]');
 s.click();
 """ 
end

 

 

 

which takes a lot (but not all, by any means) of the grief out of quoting and escaping and interpolating variables. Translating that to PAD's requirements was not fun.

 

Has anybody found an easy way to handle multi-line strings in PAD?

Thanks very much for reading this.

 

Regards,

burque505

I have the same question (0)
  • miketran13 Profile Picture
    720 on at

    Hello,

     

    I'm not sure this is what you are looking for. But, in PAD you can do this:

     

    runjavascript.png

     

    Thanks and hope it can help you. 

    Mike

    ---------------------------------

    Did I answer your question? Please consider to Mark my post as a solution! to guide others

  • Verified answer
    burque505 Profile Picture
    398 on at

    @miketran13, that certainly helps for Javascript in the browser, greatly appreciated. My concern is regarding setting multi-line variables from the GUI.

    If you look at my loop code above from Robin, I'm able to set JS into a dynamic multi-line variable using Python-like triple quoting.

    In PAD (and in WinAutomation, if I recall) this requires using %% around the variable, of course, with some other syntactic and quoting differences.

    I'm fairly sure from examining "script.robin" in a number of scripts I've created so far that Robin in PAD also uses triple quoting. I get the feeling, therefore, that all that would be needed would be to allow multi-line edits in the edit field for setting variables. Granted, the 'Set variable' input field expands to accommodate content (see below). I'm willing to bet changing the properties of the 'Set variable' input field to multi-line and allowing carriage returns could fix this. Any thoughts?

     

    the_js.PNG

    If you try hitting 'Enter' while editing that you'll see my quandary.

     

    EDIT: Here is a workaround:

     

    Instead of setting a variable with the 'Set variable' action, use "Display input dialog" and set to multi-line.

    m.PNG

     

     

    Thanks again for your help!

    Regards,

    burque505

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

#2
11manish Profile Picture

11manish 164 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 138 Super User 2026 Season 2

Last 30 days Overall leaderboard