Filter Data Specifiy Filtyer Conditions only allows up to 5 tests

A

Ant

I'm trying to filter a repeating table, the data source of which is a Web
Service. The Web Service being invoked returns many rows, but I'm only
interested in about 15 that are returned. I know the exact values returned in
one of the table columns, so I am filtering on these values. Unfortunately,
InfoPath only allows up to 5 such tests on 'equal to' being 'or'd together. I
can't just add a second or third filter, as the first filter restricts the
records available. I've tried to use XPath (my knowledge of which is sadly
lacking), but it keeps complaining that my query is not a node set, so I
figured I can only perform one conditional test.

For one reason or another, I'm only interested in the style sheet that
InfoPath produces. This will be run from another program to display the data
as designed in InfoPath. So I can't use any InfoPath scripting (which is just
as well, as I'm not familiar with that either).

Any ideas/suggestions as to how I can filter the data I need?
 
S

Scott L. Heim [MSFT]

Hi,

Here is an example of using an XPATH expression to limit the
records...maybe this will assist you:

** NOTE: This expression is based on an InfoPath form that is bound to the
Orders table from the Northwind sample database.

//dfs:myFields/dfs:dataFields/d:Orders[@OrderID = "10248"]

This drills down through the hierarchy to the Orders node and then executes
a "where" on that node to return only the one order where the OrderID =
10248.

You will also notice the use of the "@" symbol before OrderID - this is
needed only because the OrderID field is an "attribute" and not an
"element." If your fields are elements then you can remove that symbol.

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Ant

Scott, thanks for your response, very useful to an XPath Newbie. Using the
Filter Data option of an InfoPath repeating table, I set one of my data bound
fields to match a pattern. I then set up a custom patter like:

Eggs|Bacon|Milk

This worked OK in InfoPath, but not so in my .NET program that uses the
InfoPath generated style sheet. I was already implementing XSLT extensions
for some of the InfoPath methods (xmlns:xdxDocument), I just had to add
another for the xdUtil:Match method used for the pattern matching
(xmlns:xdUtil).

Once again, thanks for your speedy response.
 

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