To clarify, the list is a secondary ds list of states. The field being
validated is in a repeating address list, where state is one of the elements
of an address.
> I create forms in vb.net pulling info from Outlook. The IP form has a drop
> down list of states, but if a value from outlook is not in the list the user
> gets on indication of the problem. What type of xpath statement can I use to
> see if a value exists in a list?
While you've provided additional info, it is still difficult for someone to
tell you what kind of XPath expression you'll need. But here are some
pointers: You could use a filter on the secondary ds looking for the selected
value and then count the amount of nodes that result from that. If the
count() is zero, the item does not exist in the list. I did something similar
in this article:
http://enterprise-solutions.swits.net/infopath2007/display-message-box-when-item
-does-not-exist-in-combo-box.htm
Alternatively, if you're writing code, you could retrieve the secondary ds
using the DataSources object, loop through all the rows in the ds and check
whether the selected value exists.
---
S.Y.M. Wong-A-Ton
> To clarify, the list is a secondary ds list of states. The field being
> validated is in a repeating address list, where state is one of the elements
[quoted text clipped - 4 lines]
> > gets on indication of the problem. What type of xpath statement can I use to
> > see if a value exists in a list?
Bob C. - 18 Sep 2007 16:12 GMT
Thanks SYM,
I was hoping for a Count type of xpath statement. In psudo-code it'd look
like this:
count the number of entries in the state_validation_list that match the
value of the field.
I'll pursue your recommendations.
> While you've provided additional info, it is still difficult for someone to
> tell you what kind of XPath expression you'll need. But here are some
[quoted text clipped - 18 lines]
> > > gets on indication of the problem. What type of xpath statement can I use to
> > > see if a value exists in a list?