how to select items from list A that don't exist in list B

V

Vielka

I have two SharePoint list:
List A: list of events
List B: list of postmortems associated to events

Both lists have an event_id column, and every event may have an associated
postmortem.

I want a form with a drop down box that shows the list of events from "List
A" that don't have a postmortem associated in "List B", using the event_id
field.

I though the query should be something like:
not(@ID =
preceding::xdXDocument:GetDOM("Postmortems")/dfs:myFields/dfs:dataFields/dfs:postmortems/@event_id)

But infopath doesn't allow it.

How can I filter something like that?
 
G

Greg Collins [InfoPath MVP]

Try your xpath without the "preceding::" part. You cannot call xdXDocument is not valid as part of preceding::

not(@ID = xdXDocument:GetDOM("Postmortems")/dfs:myFields/dfs:dataFields/dfs:postmortems/@event_id)

This still may not work, but I'm not positive that it won't. It is possible that this will compare against all postmortem IDs... or it might just compare against the first ID. If it doesn't work, you can try something like:

not(xdXDocument:GetDOM("Postmortems")/dfs:myFields/dfs:dataFields/dfs:postmortems@event_id[. = current()/@ID])


--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


I have two SharePoint list:
List A: list of events
List B: list of postmortems associated to events

Both lists have an event_id column, and every event may have an associated
postmortem.

I want a form with a drop down box that shows the list of events from "List
A" that don't have a postmortem associated in "List B", using the event_id
field.

I though the query should be something like:
not(@ID =
preceding::xdXDocument:GetDOM("Postmortems")/dfs:myFields/dfs:dataFields/dfs:postmortems/@event_id)

But infopath doesn't allow it.

How can I filter something like that?
 
V

Vielka

Thanks a lot, it worked without the "preceding::" part.

I'm using:
@ID = not(@ID = /dfs:myFields/dfs:dataFields/dfs:postmortems/@event_id)



"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message
Try your xpath without the "preceding::" part. You cannot call xdXDocument
is not valid as part of preceding::

not(@ID =
xdXDocument:GetDOM("Postmortems")/dfs:myFields/dfs:dataFields/dfs:postmortems/@event_id)

This still may not work, but I'm not positive that it won't. It is possible
that this will compare against all postmortem IDs... or it might just
compare against the first ID. If it doesn't work, you can try something
like:

not(xdXDocument:GetDOM("Postmortems")/dfs:myFields/dfs:dataFields/dfs:postmortems@event_id[.
= current()/@ID])


--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


I have two SharePoint list:
List A: list of events
List B: list of postmortems associated to events

Both lists have an event_id column, and every event may have an associated
postmortem.

I want a form with a drop down box that shows the list of events from "List
A" that don't have a postmortem associated in "List B", using the event_id
field.

I though the query should be something like:
not(@ID =
preceding::xdXDocument:GetDOM("Postmortems")/dfs:myFields/dfs:dataFields/dfs:postmortems/@event_id)

But infopath doesn't allow it.

How can I filter something like that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top