Secondary Data Source Filter Problem

J

JDArsenault

I've exhausted every suggestion (to my best ability) in this discussion group
before asking this question.

The senario:
I created a SQL view which shows me groups & supervisors. (1 group may have
many supervisors.)

In infopath I created a group field in which I want look up values from a
database connection, in which I created a database connection (Connection 1)
to this view. I modified the sql statement to select distinct groups (no
supervisors). This field works fine.

In infopath I created a supervisor field in which I want look up values from
a database connection, in which I created a database connection (Connection
2) to the same view. I modified the sql statement to select distinct
supervisors &
groups. This field works fine & returns supervisors, as is.

Now I want to limit the supervisors shown in the supervisor field according
to the group chosen in the group field. On the supervisor field properties, I
choose the Entries x-path button & choose the Filter Data button. I choose
the group
field from the Connection 2 data source, (which also supplies the supervisor
field) is equal to Connection 1 data source group field. I get the full list
of supervisors, not filtered.

My Entries field looks like this:
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor[@Group =
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Group]

I get the same thing visa-versa when I choose the group field from the
Connection 1 data source, is equal to Connection 2 data source group field.

What am I missing?
 
G

Greg Collins [InfoPath MVP]

If the following is what you are using:

/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor[@Group =
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Group]

Then this is a problem. Why? Because you are checking the exact same field against itself. Basically, strip everything else away and you are checking if @Group = @Group. Which, of course, will always be true.

You mentioned two data connections... the filter should be comparing @Group against the other data connection. When you select your field (the second @Group), make sure you are selecting it from the second data connection, and not from the same data connection.

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


I've exhausted every suggestion (to my best ability) in this discussion group
before asking this question.

The senario:
I created a SQL view which shows me groups & supervisors. (1 group may have
many supervisors.)

In infopath I created a group field in which I want look up values from a
database connection, in which I created a database connection (Connection 1)
to this view. I modified the sql statement to select distinct groups (no
supervisors). This field works fine.

In infopath I created a supervisor field in which I want look up values from
a database connection, in which I created a database connection (Connection
2) to the same view. I modified the sql statement to select distinct
supervisors &
groups. This field works fine & returns supervisors, as is.

Now I want to limit the supervisors shown in the supervisor field according
to the group chosen in the group field. On the supervisor field properties, I
choose the Entries x-path button & choose the Filter Data button. I choose
the group
field from the Connection 2 data source, (which also supplies the supervisor
field) is equal to Connection 1 data source group field. I get the full list
of supervisors, not filtered.

My Entries field looks like this:
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor[@Group =
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Group]

I get the same thing visa-versa when I choose the group field from the
Connection 1 data source, is equal to Connection 2 data source group field.

What am I missing?
 
J

JDArsenault

This sounded like a good try. I couldn't get it to work though. So I created
2 separate views in SQL, 1 with group & the other with group & supervisor.

In infopath I created a group field in which I look up values from a
database connection, in which I created a database connection (Connection 1)
to view 1. This field works fine.

In infopath I created a supervisor field in which I look up values from a
database connection, in which I created a database connection (Connection 2)
to view 2. This field works fine & returns supervisors, as is.

Now I want to limit the supervisors shown in the supervisor field according
to the group chosen in the group field. On the supervisor field properties, I
choose the Entries x-path button & choose the Filter Data button. I choose
the group field from the Connection 2 data source, (which also supplies the
supervisor field) is equal to Connection 1 data source group field. I get the
full list
of supervisors, still not filtered.

Now My Entries field looks like this:
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Supervisor[../@Group
= xdXDocument:GetDOM "InfoPathGroups")
/dfs:myFields/dfs:dataFields/d:InfoPathGroups/@Group]

Greg Collins said:
If the following is what you are using:

/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor[@Group =
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Group]

Then this is a problem. Why? Because you are checking the exact same field against itself. Basically, strip everything else away and you are checking if @Group = @Group. Which, of course, will always be true.

You mentioned two data connections... the filter should be comparing @Group against the other data connection. When you select your field (the second @Group), make sure you are selecting it from the second data connection, and not from the same data connection.

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


I've exhausted every suggestion (to my best ability) in this discussion group
before asking this question.

The senario:
I created a SQL view which shows me groups & supervisors. (1 group may have
many supervisors.)

In infopath I created a group field in which I want look up values from a
database connection, in which I created a database connection (Connection 1)
to this view. I modified the sql statement to select distinct groups (no
supervisors). This field works fine.

In infopath I created a supervisor field in which I want look up values from
a database connection, in which I created a database connection (Connection
2) to the same view. I modified the sql statement to select distinct
supervisors &
groups. This field works fine & returns supervisors, as is.

Now I want to limit the supervisors shown in the supervisor field according
to the group chosen in the group field. On the supervisor field properties, I
choose the Entries x-path button & choose the Filter Data button. I choose
the group
field from the Connection 2 data source, (which also supplies the supervisor
field) is equal to Connection 1 data source group field. I get the full list
of supervisors, not filtered.

My Entries field looks like this:
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor[@Group =
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Group]

I get the same thing visa-versa when I choose the group field from the
Connection 1 data source, is equal to Connection 2 data source group field.

What am I missing?
 
G

Greg Collins [InfoPath MVP]

According to your descriptions, your filter looks correct. But I might be missing something...

One question I must ask, regardless of how silly it may seem, is whether your Connection2 supervisors have all the same group associated with them, or have different groups associated with them. If all the same group, then what you are experiencing would be expected.

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


This sounded like a good try. I couldn't get it to work though. So I created
2 separate views in SQL, 1 with group & the other with group & supervisor.

In infopath I created a group field in which I look up values from a
database connection, in which I created a database connection (Connection 1)
to view 1. This field works fine.

In infopath I created a supervisor field in which I look up values from a
database connection, in which I created a database connection (Connection 2)
to view 2. This field works fine & returns supervisors, as is.

Now I want to limit the supervisors shown in the supervisor field according
to the group chosen in the group field. On the supervisor field properties, I
choose the Entries x-path button & choose the Filter Data button. I choose
the group field from the Connection 2 data source, (which also supplies the
supervisor field) is equal to Connection 1 data source group field. I get the
full list
of supervisors, still not filtered.

Now My Entries field looks like this:
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Supervisor[../@Group
= xdXDocument:GetDOM "InfoPathGroups")
/dfs:myFields/dfs:dataFields/d:InfoPathGroups/@Group]

Greg Collins said:
If the following is what you are using:

/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor[@Group =
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Group]

Then this is a problem. Why? Because you are checking the exact same field against itself. Basically, strip everything else away and you are checking if @Group = @Group. Which, of course, will always be true.

You mentioned two data connections... the filter should be comparing @Group against the other data connection. When you select your field (the second @Group), make sure you are selecting it from the second data connection, and not from the same data connection.

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


I've exhausted every suggestion (to my best ability) in this discussion group
before asking this question.

The senario:
I created a SQL view which shows me groups & supervisors. (1 group may have
many supervisors.)

In infopath I created a group field in which I want look up values from a
database connection, in which I created a database connection (Connection 1)
to this view. I modified the sql statement to select distinct groups (no
supervisors). This field works fine.

In infopath I created a supervisor field in which I want look up values from
a database connection, in which I created a database connection (Connection
2) to the same view. I modified the sql statement to select distinct
supervisors &
groups. This field works fine & returns supervisors, as is.

Now I want to limit the supervisors shown in the supervisor field according
to the group chosen in the group field. On the supervisor field properties, I
choose the Entries x-path button & choose the Filter Data button. I choose
the group
field from the Connection 2 data source, (which also supplies the supervisor
field) is equal to Connection 1 data source group field. I get the full list
of supervisors, not filtered.

My Entries field looks like this:
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor[@Group =
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Group]

I get the same thing visa-versa when I choose the group field from the
Connection 1 data source, is equal to Connection 2 data source group field.

What am I missing?
 
J

JDArsenault

No Sir, they don't. One group may have multiple people listed as supervisors,
but supervisors are not associated with multiple groups.

Greg Collins said:
According to your descriptions, your filter looks correct. But I might be missing something...

One question I must ask, regardless of how silly it may seem, is whether your Connection2 supervisors have all the same group associated with them, or have different groups associated with them. If all the same group, then what you are experiencing would be expected.

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


This sounded like a good try. I couldn't get it to work though. So I created
2 separate views in SQL, 1 with group & the other with group & supervisor.

In infopath I created a group field in which I look up values from a
database connection, in which I created a database connection (Connection 1)
to view 1. This field works fine.

In infopath I created a supervisor field in which I look up values from a
database connection, in which I created a database connection (Connection 2)
to view 2. This field works fine & returns supervisors, as is.

Now I want to limit the supervisors shown in the supervisor field according
to the group chosen in the group field. On the supervisor field properties, I
choose the Entries x-path button & choose the Filter Data button. I choose
the group field from the Connection 2 data source, (which also supplies the
supervisor field) is equal to Connection 1 data source group field. I get the
full list
of supervisors, still not filtered.

Now My Entries field looks like this:
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Supervisor[../@Group
= xdXDocument:GetDOM "InfoPathGroups")
/dfs:myFields/dfs:dataFields/d:InfoPathGroups/@Group]

Greg Collins said:
If the following is what you are using:

/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor[@Group =
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Group]

Then this is a problem. Why? Because you are checking the exact same field against itself. Basically, strip everything else away and you are checking if @Group = @Group. Which, of course, will always be true.

You mentioned two data connections... the filter should be comparing @Group against the other data connection. When you select your field (the second @Group), make sure you are selecting it from the second data connection, and not from the same data connection.

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


I've exhausted every suggestion (to my best ability) in this discussion group
before asking this question.

The senario:
I created a SQL view which shows me groups & supervisors. (1 group may have
many supervisors.)

In infopath I created a group field in which I want look up values from a
database connection, in which I created a database connection (Connection 1)
to this view. I modified the sql statement to select distinct groups (no
supervisors). This field works fine.

In infopath I created a supervisor field in which I want look up values from
a database connection, in which I created a database connection (Connection
2) to the same view. I modified the sql statement to select distinct
supervisors &
groups. This field works fine & returns supervisors, as is.

Now I want to limit the supervisors shown in the supervisor field according
to the group chosen in the group field. On the supervisor field properties, I
choose the Entries x-path button & choose the Filter Data button. I choose
the group
field from the Connection 2 data source, (which also supplies the supervisor
field) is equal to Connection 1 data source group field. I get the full list
of supervisors, not filtered.

My Entries field looks like this:
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor[@Group =
/dfs:myFields/dfs:dataFields/d:InfoPathGroupsSupervisor/@Group]

I get the same thing visa-versa when I choose the group field from the
Connection 1 data source, is equal to Connection 2 data source group field.

What am I missing?
 

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