Skip to main content
Nintex Community Menu Bar

Xpath in XML Query for attachment file names of SharePoint Item

  • August 14, 2020
  • 3 replies
  • 58 views

Forum|alt.badge.img+1

Hi Everyone,

 

I'm trying to query attachment file names items in a SharePoint list. I've got the xml content I need (I think), but there's an "m: properties" item in front of the data I want (FileName). I tried searching various sources but couldn't figure out how to get around the "m:properties" to get to FileName. 

 

Based on some other posts, here's what I've tried so far with no luck: 

//d:FileName

- //*[local-name()=FileName]

 

Here's a snippet of the xml: 

<m:properties><d:FileName>IF_MIDAS_1page.pdf</d:FileName><

 

Can anyone help me handle the "m:properties" properly to get to the file name?  

 

Thanks!

3 replies

Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • August 19, 2020
Hi,

Are you able to provide all the XML that you are working with?

Forum|alt.badge.img+1
  • Author
  • August 20, 2020

Sure thing! It's attached now.

 

The api I'm using is: _api/web/Lists/getbytitle('ListTitle')/items(CurrentItemID)/AttachmentFiles

 

I could go one step further and do $select but it doesn't seem to get ,me out of the "m properties" thing. 


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • August 20, 2020
HI.

My test showed that the following Xpath Worked.
/defaultNS:feed/defaultNS:entry/defaultNS:content/m:properties/d:FileName