Skip to main content

Hi Community,

here is my guide how you can do it 👇👀

Step 1️⃣:
Use the "Log to File: Log text to file" action and set the "File path" to a file with a .js extension. (C:\Users\marc.mueller\Desktop\AA_Slider.js)

Put your JavaScript code in the "Enter text to log" textbox with your variables. (see screenshot) 👀

⚠️Make sure to set the "When logging" property to "Overwrite existing log file" to have the current variable in your JavaScript code.⚠️

Step 2️⃣:
I the 🌐"Browser: Run JavaScript" action set the "JavaScript to run" as "Import existing file" and point to the same file we have specified in Step 1️⃣.


I hope you find this useful.

 

Now I am curious to hear about your solutions?


Cheers
Marc

 

 

That is how I do it too!

There is also an action called String: Evaluate variable that does the same thing, but keeps the values in a variable rather than having to write to a file.


I’m also doing it this way for all my JS file creations.

However, it seems like there may be a file size limit to this method.

I actually asked about this yesterday:

Browser: Run Javascript fails to work with larger files are imported | Community


@Marc 1985, thank you for sharing this!


That is how I do it too!

There is also an action called String: Evaluate variable that does the same thing, but keeps the values in a variable rather than having to write to a file.

@Aaron.Gleason  in more details or images please ?


@a000hmedrpa Here ya go!  😁

Let’s say you have a string variable, $sFirstName$, that you want to put into an email. The email is in HTML format in $sEmail$.

String: Assign - $sFirstName$ = "Aaron"

String: Assign - $sEmail$ = "<p>Hello $sFirstName$,</p><p>Thank you for registering.</p>"

Notice the $sEmail$ contains $sFirstName$ without quotes or any other notations.

String: Evaluate variable $sEmail$ to $sMergedEmail$

The value of $sMergedEmail$ is now: <p>Hello Aaron,</p><p>Thank you for registering.</p>

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/string-package-evaluate-variable-action.html


@a000hmedrpa Here ya go!  😁

 

@Aaron.Gleason thanks alot sir _U R amazing✅