Hello. I had a similar question a couple of months ago. Basically I'm trying to pull a certain node's information based on another node. XML below so you can see what I'm referring to.
Now based on the Corporate ID in the file I want to choose the Incident number so I can place that in a variable.
Using the below xpath I can do the reverse and pull the corporate ID.
Since Incident_Number is the parent node I can't seem to figure out how to reverse that. Does anyone have any thoughts?
Thanks in advance.
following XPath expression should work
Yes that did it so helpful as always Marian. I was just added another detail to that request. Another node was added. This one is called description. It now looks like below:
that should be easy one already, shouldn't it?
that returns whole description. apply a regular expression to cut out your identifier
Haha yes I did try that exact expression. And you are correct it does pull the whole description. I guess I should completely explain my goal. Using your first expression will get me a number of incident numbers. Of which I need only one. So to be specific I can have the below in two Outputs. But the information in bold is what I would like to specifically pull. So even though I can Regedit and pluck the DFR404 out I would need it associated with it's correct Incident number. I have an advantage that the DFR404 "number" is just the list ID (of the same list I have this workflow on) just with DFR added to the front. So basically I'm sending an email to create a ticket in our ticketing system with that info then placing a pause in my workflow in which an outside SharePoint script generates the XML every hour with that information and when my workflow resumes I want to pluck the relevant info to place into a field in my list. Does that make sense?
DFR404 Human Resources
IDs: reset passwords
to be honest, I'm not quite sure what's exactly your concern.
do you have doubts how to match related content of the same (parent) node out of two result sets (collections)?
if so, then if both result sets are returned by the same action, you can be sure that related data are at the same index position in both result sets.
or do you mean you only want to return incident ID(s) where both corporate and description elements satisfy some condition(s) at same time?
then XPath expression like follows might suit you
//INCIDENT_NUMBER[./CORPORATE_ID='USEID25' and contains(./DESCRIPTION/text(),'DRF')]/@ID
Definitely the second option is what I'm looking for, although I tried your expression and got nothing from my Output. I did copy and paste the XML we've been using in this thread and tried again and it did work. But it's a very shortened version of the XML I'm actually using. I'm wondering if that's the reason why I'm geting nothing in my Output. The full array is below.
Yes it did!! So sorry to bug you more than I needed to. It turns out it was DFR not DRF. So it now it works. One last thing it seems to care about case. Is there a way to get past that? Because some of the usernames are in upper case others are not. If it's too much of an issue I'll just create a calculated field to uppercase everything.
Thanks SO much for your help.