Ability to run javascript (nodejs) in UIPath designer (still under development, more functionality will be added in upcoming release..!)
Click here to Edge git repository
Download and install the above nuget package to your designer then, Create a Blank Process in UIPath Designer,then add Input Dialog, Execute Javascript and Message Box activity and connect those three in sequential manner.
Create two string variables called "data" and "output"
Get any string value from user and store it in string variable "data" using Input dialog activity.
Pass the "data" variable value to "Data" input of execuite java script activity,(Execute javascript activity internally uses one variable name called data, which is outout of the same activity)
Pass the static string format of javascript function to "JSFunction" input of execuite java script activity
function palindrome(str) {
var re = /[\W_]/g;
var lowRegStr = str.toLowerCase().replace(re, '');
var reverseStr = lowRegStr.split('').reverse().join('');
if (reverseStr === lowRegStr) {
return 'Yes, ' + str + ' is a palindrome..!';
} else {
return 'No, ' + str + ' is not a palindrome..!';
}
}
data=palindrome(data); //data will be both input and output
Map the "output" variable as Result of execuite java script activity and Map the "output" variable to Message box to show the result to user..!
Run the bot & try to give different kind of inputs like "MADAM", "INDIA", "APPLE", etc