cancel
Showing results for 
Search instead for 
Did you mean: 
jpmhuls
Nintex Newbie

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

Hi Caroline,

Here's the XML result from the REST service GetFolderByServerRelativeUrl with "Files/?$expand=ListItemAllFields&$select=ListItemAllFields/Id,Name". As mentioned /*[local-name()='Name'] works like a charm, but for'Id' or 'ID' it doesn't (an example I made bold and red in the XML below.

<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://myspserver.com/sites/spsite/_api/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>620b82b7-41b0-4a85-9f83-6117530f9ce8</id><title /><updated>2017-10-26T09:05:25Z</updated><entry><id>http://myspserver.com/sites/spsite/_api/Web/GetFileByServerRelativeUrl('/sites/spsite/myDocSetLib/Te... Doc Set 001/TstJPH.xml')</id><category term="SP.File" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" href="Web/GetFileByServerRelativeUrl('/sites/spsite/RawMateriaals/Test%20Doc%20Set%20001/TstJPH.xml')" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ListItemAllFields" type="application/atom+xml;type=entry" title="ListItemAllFields" href="Web/GetFileByServerRelativeUrl('/sites/spsite/myDocSetLib/Test%20Doc%20Set%20001/TstJPH.xml')/ListItemAllFields"><m:inline><entry m:etag="&quot;33&quot;"><id>Web/GetFileByServerRelativeUrl('/sites/spsite/myDocSetLib/Test Doc Set 001/TstJPH.xml')/ListItemAllFields</id><category term="SP.Data.RawMaterialsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" href="Web/GetFileByServerRelativeUrl('/sites/spsite/myDocSetLib/Test%20Doc%20Set%20001/TstJPH.xml')/ListItemAllFields" /><title /><updated>2017-10-26T09:05:25Z</updated><author><name /></author><content type="application/xml"><mSmiley Tongueroperties><d:Id m:type="Edm.Int32">25628</d:Id><d:ID m:type="Edm.Int32">25628</d:ID></mSmiley Tongueroperties></content></entry></m:inline></link><title /><updated>2017-10-26T09:05:25Z</updated><author><name /></author><content type="application/xml"><mSmiley Tongueroperties><d:Name>TstJPH.xml</d:Name></mSmiley Tongueroperties></content></entry><entry><id>http://myspserver.com/sites/spsite/_api/Web/GetFileByServerRelativeUrl('/sites/spsite/myDocSetLib/Te... Doc Set 001/TestPlans_Case01_TstJPH.xlsx')</id><category term="SP.File" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" href="Web/GetFileByServerRelativeUrl('/sites/spsite/myDocSetLib/Test%20Doc%20Set%20001/TestPlans_Case01_TstJPH.xlsx')" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ListItemAllFields" type="application/atom+xml;type=entry" title="ListItemAllFields" href="Web/GetFileByServerRelativeUrl('/sites/spsite/myDocSetLib/Test%20Doc%20Set%20001/TestPlans_Case01_TstJPH.xlsx')/ListItemAllFields"><m:inline><entry m:etag="&quot;43&quot;"><id>Web/GetFileByServerRelativeUrl('/sites/spsite/myDocSetLib/Test Doc Set 001/TestPlans_Case01_TstJPH.xlsx')/ListItemAllFields</id><category term="SP.Data.RawMaterialsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" href="Web/GetFileByServerRelativeUrl('/sites/spsite/myDocSetLib/Test%20Doc%20Set%20001/TestPlans_Case01_TstJPH.xlsx')/ListItemAllFields" /><title /><updated>2017-10-26T09:05:25Z</updated><author><name /></author><content type="application/xml"><mSmiley Tongueroperties><d:Id m:type="Edm.Int32">25629</d:Id><d:ID m:type="Edm.Int32">25629</d:ID></mSmiley Tongueroperties></content></entry></m:inline></link><title /><updated>2017-10-26T09:05:25Z</updated><author><name /></author><content type="application/xml"><mSmiley Tongueroperties><d:Name>TestPlans_Case01_TstJPH.xlsx</d:Name></mSmiley Tongueroperties></content></entry></feed>
0 Kudos
Reply
Automation Master
Automation Master

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

When trying this XPath: //*[local-name()='Id'], what do you get as a result ?

Reply
jpmhuls
Nintex Newbie

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

It returns:

Output 1

With the cursor on the next line. However, if I include e.g. ServerRelativeUrl in the GetFolder Rest call and use it instead of 'Id', then I do get results; same for 'Name'.

0 Kudos
Reply
jpmhuls
Nintex Newbie

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

Just out of curiosity: is my GetFolderByServerRelativeUrl call using "/Files/?$expand=ListItemAllFields&$select=ListItemAllFields/Id,Name" at the end correct? In other examples I notice the $select to be used first prior to the $expand....

0 Kudos
Reply
Automation Master
Automation Master

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

I think that the order in which url parameters are declared has no importance and it will always work but I didn't test putting these parameters in another order

Reply
Automation Master
Automation Master

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

That's strange, I've tested in my SharePoint 2013 OnPrem environment and the following XPath works

//*[local-name()='Id']

Which version of Nintex Workflow do you use and in which environment?

Reply
jpmhuls
Nintex Newbie

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

Ninitex Workflow 2013 On-Premise Version: 3.2.3.2

But I think with extracting ServerRelativeUrl I can get the job done as well, combination with QueryList.

0 Kudos
Reply
Automation Master
Automation Master

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

ok, it can be an alternative

0 Kudos
Reply
jpmhuls
Nintex Newbie

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

Hi Caroli,

It seems that in Run Now mode "/defaultNS:feed/defaultNS:entry/defaultNS:content/*/*[local-name()='Id']" indeed does not seem to work (it does for other columns). However, using the short notation "//*[local-name()='Id']" does indeed return the proper ids; initially this did not seem to work for me in Run now mode, but that turned out to be due to a typo.

Thank you anyway.

BR,

Jean-Pierre

0 Kudos
Reply
Automation Master
Automation Master

Re: Parsing Web Request (NOT Call Web Service) Response XML

Jump to solution

ok, that's good news

0 Kudos
Reply