Extracting QR Code data in Power Automate

Consider a PDF with a cover page which contains the following QR code (containing the data “123456789, John Smith”). This pdf triggers a Power Automate flow.

The Power Automate steps below show how the barcode data is extracted (by an Aquaforest connector) so that it can be used within the remainder of the flow.

The first action ‘Get barcode value’ extracts the data from the barcode. The data extracted by the ‘Get barcode value’ is:

{
“pageNumber”: “1”,
“valueExtracted”: “123456789, John Smith”,
“zoneValues”: [
“123456789, John Smith”
]
}

Since there could be several barcodes on the one PDF, the next action in the flow is ‘Apply to each’.

The schema that the ‘Get barcode value’ produces is added to the ‘Parse JSON’ action. This allows Power Automate to be able to parse the values and use them in the remainder of the flow

The value “valueExtracted”: “123456789, John Smith” that is produced by the ‘Parse JSON’ action is assigned to the variable ‘Barcode String’. (Please note that there seems to be a product bug where the extracted values aren’t always available in the ‘Dynamic content’ window. In this case, it’s necessary to manually type the expression in the ‘Expression’ window.)

The ‘Split’ expression is then used to extract the delimited values

Client Id is assigned the value 123456789

The Split expression would be used again to extract the client name i.e. split(variables(‘Barcode string’),’,’)[1]