cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Xpath in Query XML

Jump to solution

How can we retrieve Title data through Query XML for below mentioned response. 


<d:Title>Project Name</d:Title>

Tags (1)
0 Kudos
Reply
9 Replies
Workflow Hero

Re: Xpath in Query XML

Jump to solution

Hi!

Just as simple as "//d:Title"

Regards,

Tomasz

Regards, Tomasz Poszytek
Reply
Workflow Hero

Re: Xpath in Query XML

Jump to solution

Thank you , Tomasz

0 Kudos
Reply
Workflow Hero

Re: Xpath in Query XML

Jump to solution

Hi Kris,

You can also use the following XPath to extract the title:

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

and the following to extract the ID :

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

Hope this helps

Reply
Workflow Hero

Re: Xpath in Query XML

Jump to solution

Hi 

How can we retrieve back values like below mentioned response .

<?xml version="1.0" encoding="utf-8"?><feed xml:base="https://XX.com/XX/_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>13b62e11-6d5c-4572-8dc4-f3123234d89d</id><title /><updated>2017-08-29T15:46:35Z</updated><entry><id>https://xxx/plmpwa/_api/ProjectServer/CustomFields('08db85ba-7f6c-e711-8108-0050569e267b')</id><category term="PS.CustomField" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" href="ProjectServer/CustomFields('08db85ba-7f6c-e711-8108-0050569e267b')" /><title /><updated>2017-08-29T15:46:35Z</updated><author><name /></author><content type="application/xml"><mSmiley Tongueroperties><d:InternalName>Custom_08db85ba7f6ce71181080050569e267b</d:InternalName><d:Name>Test Name</d:Name></mSmiley Tongueroperties></content></entry><entry><id>https://xxx/_api/ProjectServer/CustomFields('caaa1091-7f6c-e711-8108-0050569e267b')</id><category term="PS.CustomField" 

We need  Custom_08db85ba7f6ce71181080050569e267b value based on "Test Name" name

 

Thanks

Kris

0 Kudos
Reply
Workflow Hero

Re: Xpath in Query XML

Jump to solution

You can use the following XPath: 

//*[local-name()='Name' and .='Test Name']/../*[local-name()='InternalName']

Hope this works

Reply
Workflow Hero

Re: Xpath in Query XML

Jump to solution

Working , Thank you

Reply
Workflow Hero

Re: Xpath in Query XML

Jump to solution

Great

0 Kudos
Reply
Workflow Hero

Re: Xpath in Query XML

Jump to solution

In my case I am getting 5 items in REST call, I need to get all 5 titles from XML, can yoou help me it?

0 Kudos
Reply
Workflow Hero

Re: Xpath in Query XML

Jump to solution

If you use a Query XML action with the following XPath and you store the result in a collection variable, you should get 5 items in the collection variable:

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

Hope this helps

0 Kudos
Reply