Highlighted
332 views

How to pass complete array values via function called in js file

I need to pass array of values in function available in js file. Please find below the function i have used.

web_js_run(
        "Code=getpassword(LR.getParam('P_Mode'));",
        "ResultParam=response",

SOURCES,
        "File=Crypto.js", ENDITEM, LAST);

 

Instead of parameter i want to use array. Kindly provide me a syntax for the above. 

One more doubt, how to see a value getting generated inside js file. 

0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to pass complete array values via function called in js file

Hi,

You can use the code below that pass an array of 3 elements:

web_js_run(
        "Code=getpassword(['val1','val2','val3']);",
        "ResultParam=response",
        SOURCES,
        "File=Crypto.js", ENDITEM, LAST);

You can view the result param response by enabling Extended Log->Parameter substitution or

lr_output_message(lr_eval_string("Result param is = {response}"));

Best regards

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.