Question: **Through Jenkins Declarative pipeline script, is it possible to read file data and from different nodes ??**   

Example :   

I've 3 nodes (A to C).   

From A, I need to read file data from all other nodes and need to store in an array, and then From A I need to do some operations from those Array values.
I've tried with the following code.

```
pipeline{
    agent none
    stages{
        stage("Node-C"){
            agent {
                label "Node-C"
            }
            steps{
                sh '''
                   arr1=($(grep -i "docker" /opt/abc/Text1.txt))
                '''
            }
        }
        stage("Node-B"){
            agent {
                label "Node-B"
            }
            steps{
                sh '''
                   arr1+=($(grep -i "docker" /opt/abc/Text1.txt))
                '''
            }
        }
        stage("Node-A"){
            agent {
                label "Node-A"
            }
            steps{
                sh '''
                    arr1+=($(grep -i "docker" /opt/abc/Text1.txt))
                    for i in "${arr1[@]}"
                    do
                       echo "== $i =="
                    done
                '''
            }
        }
    }
}

```

Above script is printing only Node-A's File data.
But, how we can print Node-B and Node-C data also ?

Answer: 
We used LazarSofts [jsqrcode](https://github.com/LazarSoft/jsqrcode) before.

On desktop users could just upload photo with qr-code, and they had option to directly take photo with mobile phone.

I know this is not the cleanest solution, but it worked for us.

HTML: 

```
<input type=file accept="image/*" capture=environment id="qr-scanner" tabindex=-1>

```

JS

```
// open the scanner
$(document).on('change', '#qr-scanner', function (e) {
     e.preventDefault();
     e.stopPropagation();
     var scanResult = scanQR(this);
});

// process the image with scanner
function scanQR(node) {

  var reader = new FileReader();
  reader.onload = function() {
  qrcode.callback = function(res) {
    if(res instanceof Error) {
        handleScanResults(false);
    } else {
        handleScanResults(res);
    }
  };
  qrcode.decode(reader.result);
  };
  reader.readAsDataURL(node.files[0]);
}

// handle scanner results
function handleScanResults(scanResult) {
  if (scanResult) {
      alert(scanResult);
  } else {
      alert('Scan error, try again.');
  }
}

```
You most likely have [this](https://github.com/schmich/instascan/issues/150) or [this](https://github.com/schmich/instascan/issues/65) issue with instascan, are you possibly running android 7 or have a HTC device? Multiple people have reported issues with the instascan package with those devices. What you could try is [NIMIC QR scanner](https://github.com/nimiq/qr-scanner)