PowerUp Description
The FILTERXML PowerUp function calls returns the result of the provided XPath query.
Note: In Excel 2013 and later the PowerUp version of this function is pwrFILTERXML.
PowerUp Syntax
FILTERXML(<url|file|reference>, xpath)
The FILTERXML PowerUp function has the following arguments:
url|file|reference – Required. This is one of the following:
- The complete URL to call the Web Service. If this is a GET call, include the full URL including all of the needed parameters on the URL in the querystring.
- A fully qualified file path. This can also follow the “file://” protocol syntax as well.
- An Excel reference.
xpath – Required. This is the XPath query to be used to return the desired data from the XML being parsed.
Return Value
FILTERXML will return the result of the XPath query.
Remarks
The URL value provided must be a fully-formed URL. The querystring of the URL and the postdata must also be fully-encoded URL strings.
Examples for Excel 2010 and Excel 2007
=FILTERXML("http://webserviceservername/serviceurl?arg1=val1&arg2=val2", "/root/head/title")
This will submit a GET request to the webservicename/serviceurl web service and return the contents of the title element.
=FILTERXML(A1, "/root/head/title")
This return the contents of the title element of the XML contained in cell A1.
Examples for Excel 2013 and Later
=pwrFILTERXML("http://webserviceservername/serviceurl?arg1=val1&arg2=val2", "/root/head/title")
This will submit a GET request to the webservicename/serviceurl web service and return the contents of the title element.
=pwrFILTERXML(A1, "/root/head/title")
This return the contents of the title element of the XML contained in cell A1.