@Thomas Johnson You cannot use concat with xpath as first the concat will be evaluated and in case if there are any matching nodes or values then it will return the output (i.e. array values).
In the below example you can see I have used concat and concat will give the output as //trackingNumber/text() and then it will find the matching path in my variable xml.
xpath(xml(variables('xml')),concat('//trackingNumber','/text()'))
The above will give the output as below:
1233244
3443534
If you change the expression as below the concat works correctly as it returns https://mysite.com//trackingNumber/text() but the xpath gives error as https://mysite.com//trackingNumber/text()
is invalid xpath.
xpath(xml(variables('xml')),concat('https://mysite.com/','//trackingNumber/text()'))
Therefore it doesn't give you the expected output as you are looking for. The alternative will be evaluating the xpath first xpath(xml(variables('xml')),'//trackingNumber/text()') and once you have the array iterate it and append the https://mysite.com/ to a new array variable.
If you don't want to use multiple actions then you can offload this function to javascript inline code but this action needs an integration account on your logic app.
You can refer to Reference guide to expression functions for Azure Logic Apps for different methods and their usage. Hope the above clears things up.
Feel free to get back to me if you have any queries or concerns.