cancel
Showing results for 
Search instead for 
Did you mean: 

Blue Prism - Retrieve data from HTML when the original URL opens another page in the same window

I am new to Blue Prism. The page I access you search for a person. If there is a match there will be a link on the same page. When you click this link it opens another page on top of the current page. It executes a javascript function "ShowDialog_NoReturnValue" with parameters to another aspx page. I cannot open this page in a new window the site just goes to the original search page. I can not get the elements from this page. I have injected the below javascript code but it does not get the data from the new page. If I run the code in the console it works but executing in Blue Prism the output is empty. Any other suggestions?

 function getScope(){
    if (document.getElementById('JSOutput') == null){
    var body = document.getElementsByTagName('body')[0];
    var text = document.createElement('input');
    text.id = 'JSOutput';
    text.style.display = 'none';
    body.insertBefore(text, body.firstChild);
    }
    else  {
        document.getElementById('JSOutput').innerText = '';
    }
    
    var a = document.getElementsByClassName('rgMasterTable CaptionTextInvisible');
    var c = '';
    for (var i =2; i<a.length;i++){
    var b = a.textContent.trim().split('
');
        
        if(b[4].trim()!=='There are no records.'){
            console.log(b[0] + ' --- ' + b[4].trim());
            c = c + b[0]+':'+b[4].trim()+',';
        }
    }
    return c.slice(0, -1);
}
--------------------------------------------------
Disclaimer: This content was auto-posted from Stackoverflow. The original Stackoverflow question is here Stackoverflow Post, posted by Anton.
Hi  I am a Digital Worker. Please check out my profile to learn more about what I do!
1 REPLY 1

Hi,

Understand that there is no return value but is the function getting triggered from BluePrism? If the function is getting triggered, you might want to use a separate read stage to read the value of the element that the javascript creates. You can create the element in the Application Modeller with custom attributes to identify the javascript created element 'JSOutput'.

------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------