Binding / Query question

A

Art

I am writing this in the hopes that someone here comes up with answer before
I figure this out.

Two data sources -
Main Connection is a table with fields A1, A2 and A3
Secondary Data Connection - S1,S2, S3

I created a repeating table to display A1, A2 and A3. I changed A1 to a
drop down box and populated the drop down by binding it to the Secondary Data
Connection. Therefore the drop down displays the data elements in S1.

What I am trying to accomplish is when a selection is made in the drop down
A1, A2 and A3 get populated with the data from S2 and S3.

Everything I have tried populates A2 and A3 with just the first row of the
Secondary Data Source and does not change based on the drop down selection.

Can someone point me in the right direction?

Thanks
 
A

Art

I will give it a try but I am trying to do in a repeating table so I hope the
same theory applies
 
S

S.Y.M. Wong-A-Ton

Yes, the article uses a repeating table. And current() is used when using a
repeating table.
 
A

Art

I poked around some more and here is something I found that I thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID =
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path of a field
or group.

What am I not undertanding?
 
A

Art

I also went back throiugh you link and tried this

@inventory=@inventory[@description=current()]

the two @ inventories are form the main and secondary source respectively
and the @description is the name of the dropdown that triggers the event

I wantto thank you for your help. You and this forum and been a blessing.
I only hope I can contribute as much in the future.



Art said:
I poked around some more and here is something I found that I thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID =
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path of a field
or group.

What am I not undertanding?

S.Y.M. Wong-A-Ton said:
Yes, the article uses a repeating table. And current() is used when using a
repeating table.
 
S

S.Y.M. Wong-A-Ton

Your XPath expression is incorrect; that is what the error means. What field
are you using as the value for your dropdown? That is the field you need to
set equal to current().

Finding the correct XPath expression can be a challenge. Without knowing the
structure of the XML produced by the drop-down, it is virtually impossible to
tell you what the correct expression should be.

Basically, you need to find the correct XPath to the ID field in the
dropdown and set this equal to current().
---
S.Y.M. Wong-A-Ton


Art said:
I poked around some more and here is something I found that I thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID =
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path of a field
or group.

What am I not undertanding?

S.Y.M. Wong-A-Ton said:
Yes, the article uses a repeating table. And current() is used when using a
repeating table.
 
S

S.Y.M. Wong-A-Ton

Did this work? Is @description used as the ID field for the drop-down? If
not, try using the ID field instead.

You're already doing a great job by helping others whenever you can. I
cannot say that of everybody I've helped in this newsgroup. So, no worries. :)
---
S.Y.M. Wong-A-Ton


Art said:
I also went back throiugh you link and tried this

@inventory=@inventory[@description=current()]

the two @ inventories are form the main and secondary source respectively
and the @description is the name of the dropdown that triggers the event

I wantto thank you for your help. You and this forum and been a blessing.
I only hope I can contribute as much in the future.



Art said:
I poked around some more and here is something I found that I thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID =
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path of a field
or group.

What am I not undertanding?

S.Y.M. Wong-A-Ton said:
Yes, the article uses a repeating table. And current() is used when using a
repeating table.
---
S.Y.M. Wong-A-Ton


:

I will give it a try but I am trying to do in a repeating table so I hope the
same theory applies



:

Art, check out the section "Automatically display the player's number and
position" in this article
http://enterprise-solutions.swits.n...-dropdown-list-repeating-table&c=infopath2003

You need to do something similar using the current() function.
---
S.Y.M. Wong-A-Ton


:

I am writing this in the hopes that someone here comes up with answer before
I figure this out.

Two data sources -
Main Connection is a table with fields A1, A2 and A3
Secondary Data Connection - S1,S2, S3

I created a repeating table to display A1, A2 and A3. I changed A1 to a
drop down box and populated the drop down by binding it to the Secondary Data
Connection. Therefore the drop down displays the data elements in S1.

What I am trying to accomplish is when a selection is made in the drop down
A1, A2 and A3 get populated with the data from S2 and S3.

Everything I have tried populates A2 and A3 with just the first row of the
Secondary Data Source and does not change based on the drop down selection.

Can someone point me in the right direction?

Thanks
 
A

Art

Let me try to provide a little more detail. I wish screen shots could be
posted here.

My repeating table is bound to
/dfs:myFields/dfs:dataFields/d:tblPromoItemsordered. I display ItemNumber,
Description, WebSite, Telephone, Quantity and Inventory. This is my Main
Connection.

I changed Description to a Drop Down and pull data from a secondary
datasource with these properties
/dfs:myFields/dfs:dataFields/d:tblPromoItems (secondary connection) where the
value is @ItemNumber and the display is @description.

This all works well and the drop down displays the values of decription from
tblpromoitems.

Now I want to populate the remaining fields in that row that come from the
row in the table tblpromoitems. I will use Inventory as an example.

On the Description field I set a rule that says for Conditon - If
ItemNumber (main connection) = ItemNumber (secondary connection), I set a
fields value. The field is
@inventory (main connection) and I set the value to
@Inventory[@Inventory=current()] where the first @inventory is from
tblpromoitemsordered (main connection) and the second @inventory is from
tblpromoitems (secondary connection). I also tried
@Inventory[@Description=current()] and @Inventory[@ItemNumber=current()]

Nothing ever populates in Inventory.

I hope this give you some more detail to provide advice.

Thanks again


S.Y.M. Wong-A-Ton said:
Your XPath expression is incorrect; that is what the error means. What field
are you using as the value for your dropdown? That is the field you need to
set equal to current().

Finding the correct XPath expression can be a challenge. Without knowing the
structure of the XML produced by the drop-down, it is virtually impossible to
tell you what the correct expression should be.

Basically, you need to find the correct XPath to the ID field in the
dropdown and set this equal to current().
---
S.Y.M. Wong-A-Ton


Art said:
I poked around some more and here is something I found that I thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID =
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path of a field
or group.

What am I not undertanding?

S.Y.M. Wong-A-Ton said:
Yes, the article uses a repeating table. And current() is used when using a
repeating table.
---
S.Y.M. Wong-A-Ton


:

I will give it a try but I am trying to do in a repeating table so I hope the
same theory applies



:

Art, check out the section "Automatically display the player's number and
position" in this article
http://enterprise-solutions.swits.n...-dropdown-list-repeating-table&c=infopath2003

You need to do something similar using the current() function.
---
S.Y.M. Wong-A-Ton


:

I am writing this in the hopes that someone here comes up with answer before
I figure this out.

Two data sources -
Main Connection is a table with fields A1, A2 and A3
Secondary Data Connection - S1,S2, S3

I created a repeating table to display A1, A2 and A3. I changed A1 to a
drop down box and populated the drop down by binding it to the Secondary Data
Connection. Therefore the drop down displays the data elements in S1.

What I am trying to accomplish is when a selection is made in the drop down
A1, A2 and A3 get populated with the data from S2 and S3.

Everything I have tried populates A2 and A3 with just the first row of the
Secondary Data Source and does not change based on the drop down selection.

Can someone point me in the right direction?

Thanks
 
A

Art

Thank you for the compliment

I am a long way from being proficient but I keep pushing myself to get the
most out of the application.



S.Y.M. Wong-A-Ton said:
Did this work? Is @description used as the ID field for the drop-down? If
not, try using the ID field instead.

You're already doing a great job by helping others whenever you can. I
cannot say that of everybody I've helped in this newsgroup. So, no worries. :)
---
S.Y.M. Wong-A-Ton


Art said:
I also went back throiugh you link and tried this

@inventory=@inventory[@description=current()]

the two @ inventories are form the main and secondary source respectively
and the @description is the name of the dropdown that triggers the event

I wantto thank you for your help. You and this forum and been a blessing.
I only hope I can contribute as much in the future.



Art said:
I poked around some more and here is something I found that I thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID =
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path of a field
or group.

What am I not undertanding?

:

Yes, the article uses a repeating table. And current() is used when using a
repeating table.
---
S.Y.M. Wong-A-Ton


:

I will give it a try but I am trying to do in a repeating table so I hope the
same theory applies



:

Art, check out the section "Automatically display the player's number and
position" in this article
http://enterprise-solutions.swits.n...-dropdown-list-repeating-table&c=infopath2003

You need to do something similar using the current() function.
---
S.Y.M. Wong-A-Ton


:

I am writing this in the hopes that someone here comes up with answer before
I figure this out.

Two data sources -
Main Connection is a table with fields A1, A2 and A3
Secondary Data Connection - S1,S2, S3

I created a repeating table to display A1, A2 and A3. I changed A1 to a
drop down box and populated the drop down by binding it to the Secondary Data
Connection. Therefore the drop down displays the data elements in S1.

What I am trying to accomplish is when a selection is made in the drop down
A1, A2 and A3 get populated with the data from S2 and S3.

Everything I have tried populates A2 and A3 with just the first row of the
Secondary Data Source and does not change based on the drop down selection.

Can someone point me in the right direction?

Thanks
 
A

Art

I have continued to work diligently on this and think I am getting close

My rule now says @Inventory = @Inventory[@ItemNumber = current()]

The field @Inventory gets populated but instead of returning the number from
tblpromoitems it is returning a "false" value.

Am I close?





Art said:
Let me try to provide a little more detail. I wish screen shots could be
posted here.

My repeating table is bound to
/dfs:myFields/dfs:dataFields/d:tblPromoItemsordered. I display ItemNumber,
Description, WebSite, Telephone, Quantity and Inventory. This is my Main
Connection.

I changed Description to a Drop Down and pull data from a secondary
datasource with these properties
/dfs:myFields/dfs:dataFields/d:tblPromoItems (secondary connection) where the
value is @ItemNumber and the display is @description.

This all works well and the drop down displays the values of decription from
tblpromoitems.

Now I want to populate the remaining fields in that row that come from the
row in the table tblpromoitems. I will use Inventory as an example.

On the Description field I set a rule that says for Conditon - If
ItemNumber (main connection) = ItemNumber (secondary connection), I set a
fields value. The field is
@inventory (main connection) and I set the value to
@Inventory[@Inventory=current()] where the first @inventory is from
tblpromoitemsordered (main connection) and the second @inventory is from
tblpromoitems (secondary connection). I also tried
@Inventory[@Description=current()] and @Inventory[@ItemNumber=current()]

Nothing ever populates in Inventory.

I hope this give you some more detail to provide advice.

Thanks again


S.Y.M. Wong-A-Ton said:
Your XPath expression is incorrect; that is what the error means. What field
are you using as the value for your dropdown? That is the field you need to
set equal to current().

Finding the correct XPath expression can be a challenge. Without knowing the
structure of the XML produced by the drop-down, it is virtually impossible to
tell you what the correct expression should be.

Basically, you need to find the correct XPath to the ID field in the
dropdown and set this equal to current().
---
S.Y.M. Wong-A-Ton


Art said:
I poked around some more and here is something I found that I thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID =
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path of a field
or group.

What am I not undertanding?

:

Yes, the article uses a repeating table. And current() is used when using a
repeating table.
---
S.Y.M. Wong-A-Ton


:

I will give it a try but I am trying to do in a repeating table so I hope the
same theory applies



:

Art, check out the section "Automatically display the player's number and
position" in this article
http://enterprise-solutions.swits.n...-dropdown-list-repeating-table&c=infopath2003

You need to do something similar using the current() function.
---
S.Y.M. Wong-A-Ton


:

I am writing this in the hopes that someone here comes up with answer before
I figure this out.

Two data sources -
Main Connection is a table with fields A1, A2 and A3
Secondary Data Connection - S1,S2, S3

I created a repeating table to display A1, A2 and A3. I changed A1 to a
drop down box and populated the drop down by binding it to the Secondary Data
Connection. Therefore the drop down displays the data elements in S1.

What I am trying to accomplish is when a selection is made in the drop down
A1, A2 and A3 get populated with the data from S2 and S3.

Everything I have tried populates A2 and A3 with just the first row of the
Secondary Data Source and does not change based on the drop down selection.

Can someone point me in the right direction?

Thanks
 
A

Art

GOT IT!!!!!!!!!

S.Y.M. Wong-A-Ton - if I can make a suggestion

In your document tutorial, a second or third screen shot for steps 13 and 14
woudl be helpful for others.

Thanks for all your help.

Art said:
I have continued to work diligently on this and think I am getting close

My rule now says @Inventory = @Inventory[@ItemNumber = current()]

The field @Inventory gets populated but instead of returning the number from
tblpromoitems it is returning a "false" value.

Am I close?





Art said:
Let me try to provide a little more detail. I wish screen shots could be
posted here.

My repeating table is bound to
/dfs:myFields/dfs:dataFields/d:tblPromoItemsordered. I display ItemNumber,
Description, WebSite, Telephone, Quantity and Inventory. This is my Main
Connection.

I changed Description to a Drop Down and pull data from a secondary
datasource with these properties
/dfs:myFields/dfs:dataFields/d:tblPromoItems (secondary connection) where the
value is @ItemNumber and the display is @description.

This all works well and the drop down displays the values of decription from
tblpromoitems.

Now I want to populate the remaining fields in that row that come from the
row in the table tblpromoitems. I will use Inventory as an example.

On the Description field I set a rule that says for Conditon - If
ItemNumber (main connection) = ItemNumber (secondary connection), I set a
fields value. The field is
@inventory (main connection) and I set the value to
@Inventory[@Inventory=current()] where the first @inventory is from
tblpromoitemsordered (main connection) and the second @inventory is from
tblpromoitems (secondary connection). I also tried
@Inventory[@Description=current()] and @Inventory[@ItemNumber=current()]

Nothing ever populates in Inventory.

I hope this give you some more detail to provide advice.

Thanks again


S.Y.M. Wong-A-Ton said:
Your XPath expression is incorrect; that is what the error means. What field
are you using as the value for your dropdown? That is the field you need to
set equal to current().

Finding the correct XPath expression can be a challenge. Without knowing the
structure of the XML produced by the drop-down, it is virtually impossible to
tell you what the correct expression should be.

Basically, you need to find the correct XPath to the ID field in the
dropdown and set this equal to current().
---
S.Y.M. Wong-A-Ton


:

I poked around some more and here is something I found that I thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID =
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path of a field
or group.

What am I not undertanding?

:

Yes, the article uses a repeating table. And current() is used when using a
repeating table.
---
S.Y.M. Wong-A-Ton


:

I will give it a try but I am trying to do in a repeating table so I hope the
same theory applies



:

Art, check out the section "Automatically display the player's number and
position" in this article
http://enterprise-solutions.swits.n...-dropdown-list-repeating-table&c=infopath2003

You need to do something similar using the current() function.
---
S.Y.M. Wong-A-Ton


:

I am writing this in the hopes that someone here comes up with answer before
I figure this out.

Two data sources -
Main Connection is a table with fields A1, A2 and A3
Secondary Data Connection - S1,S2, S3

I created a repeating table to display A1, A2 and A3. I changed A1 to a
drop down box and populated the drop down by binding it to the Secondary Data
Connection. Therefore the drop down displays the data elements in S1.

What I am trying to accomplish is when a selection is made in the drop down
A1, A2 and A3 get populated with the data from S2 and S3.

Everything I have tried populates A2 and A3 with just the first row of the
Secondary Data Source and does not change based on the drop down selection.

Can someone point me in the right direction?

Thanks
 
S

S.Y.M. Wong-A-Ton

Sorry for the delay in responding; I was away for a while. I'm glad you
finally solved it. And thank you for your suggestion. I'll update the article
as soon as I get a chance, since I've also come to realize that screen shots
do provide more clarity.
---
S.Y.M. Wong-A-Ton


Art said:
GOT IT!!!!!!!!!

S.Y.M. Wong-A-Ton - if I can make a suggestion

In your document tutorial, a second or third screen shot for steps 13 and 14
woudl be helpful for others.

Thanks for all your help.

Art said:
I have continued to work diligently on this and think I am getting close

My rule now says @Inventory = @Inventory[@ItemNumber = current()]

The field @Inventory gets populated but instead of returning the number from
tblpromoitems it is returning a "false" value.

Am I close?





Art said:
Let me try to provide a little more detail. I wish screen shots could be
posted here.

My repeating table is bound to
/dfs:myFields/dfs:dataFields/d:tblPromoItemsordered. I display ItemNumber,
Description, WebSite, Telephone, Quantity and Inventory. This is my Main
Connection.

I changed Description to a Drop Down and pull data from a secondary
datasource with these properties
/dfs:myFields/dfs:dataFields/d:tblPromoItems (secondary connection) where the
value is @ItemNumber and the display is @description.

This all works well and the drop down displays the values of decription from
tblpromoitems.

Now I want to populate the remaining fields in that row that come from the
row in the table tblpromoitems. I will use Inventory as an example.

On the Description field I set a rule that says for Conditon - If
ItemNumber (main connection) = ItemNumber (secondary connection), I set a
fields value. The field is
@inventory (main connection) and I set the value to
@Inventory[@Inventory=current()] where the first @inventory is from
tblpromoitemsordered (main connection) and the second @inventory is from
tblpromoitems (secondary connection). I also tried
@Inventory[@Description=current()] and @Inventory[@ItemNumber=current()]

Nothing ever populates in Inventory.

I hope this give you some more detail to provide advice.

Thanks again


:

Your XPath expression is incorrect; that is what the error means. What field
are you using as the value for your dropdown? That is the field you need to
set equal to current().

Finding the correct XPath expression can be a challenge. Without knowing the
structure of the XML produced by the drop-down, it is virtually impossible to
tell you what the correct expression should be.

Basically, you need to find the correct XPath to the ID field in the
dropdown and set this equal to current().
---
S.Y.M. Wong-A-Ton


:

I poked around some more and here is something I found that I thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID =
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path of a field
or group.

What am I not undertanding?

:

Yes, the article uses a repeating table. And current() is used when using a
repeating table.
---
S.Y.M. Wong-A-Ton


:

I will give it a try but I am trying to do in a repeating table so I hope the
same theory applies



:

Art, check out the section "Automatically display the player's number and
position" in this article
http://enterprise-solutions.swits.n...-dropdown-list-repeating-table&c=infopath2003

You need to do something similar using the current() function.
---
S.Y.M. Wong-A-Ton


:

I am writing this in the hopes that someone here comes up with answer before
I figure this out.

Two data sources -
Main Connection is a table with fields A1, A2 and A3
Secondary Data Connection - S1,S2, S3

I created a repeating table to display A1, A2 and A3. I changed A1 to a
drop down box and populated the drop down by binding it to the Secondary Data
Connection. Therefore the drop down displays the data elements in S1.

What I am trying to accomplish is when a selection is made in the drop down
A1, A2 and A3 get populated with the data from S2 and S3.

Everything I have tried populates A2 and A3 with just the first row of the
Secondary Data Source and does not change based on the drop down selection.

Can someone point me in the right direction?

Thanks
 
A

Art

Glad you are back

Your input here was missed


S.Y.M. Wong-A-Ton said:
Sorry for the delay in responding; I was away for a while. I'm glad you
finally solved it. And thank you for your suggestion. I'll update the
article
as soon as I get a chance, since I've also come to realize that screen
shots
do provide more clarity.
---
S.Y.M. Wong-A-Ton


Art said:
GOT IT!!!!!!!!!

S.Y.M. Wong-A-Ton - if I can make a suggestion

In your document tutorial, a second or third screen shot for steps 13 and
14
woudl be helpful for others.

Thanks for all your help.

Art said:
I have continued to work diligently on this and think I am getting
close

My rule now says @Inventory = @Inventory[@ItemNumber = current()]

The field @Inventory gets populated but instead of returning the number
from
tblpromoitems it is returning a "false" value.

Am I close?





:

Let me try to provide a little more detail. I wish screen shots
could be
posted here.

My repeating table is bound to
/dfs:myFields/dfs:dataFields/d:tblPromoItemsordered. I display
ItemNumber,
Description, WebSite, Telephone, Quantity and Inventory. This is my
Main
Connection.

I changed Description to a Drop Down and pull data from a secondary
datasource with these properties
/dfs:myFields/dfs:dataFields/d:tblPromoItems (secondary connection)
where the
value is @ItemNumber and the display is @description.

This all works well and the drop down displays the values of
decription from
tblpromoitems.

Now I want to populate the remaining fields in that row that come
from the
row in the table tblpromoitems. I will use Inventory as an example.

On the Description field I set a rule that says for Conditon - If
ItemNumber (main connection) = ItemNumber (secondary connection), I
set a
fields value. The field is
@inventory (main connection) and I set the value to
@Inventory[@Inventory=current()] where the first @inventory is from
tblpromoitemsordered (main connection) and the second @inventory is
from
tblpromoitems (secondary connection). I also tried
@Inventory[@Description=current()] and
@Inventory[@ItemNumber=current()]

Nothing ever populates in Inventory.

I hope this give you some more detail to provide advice.

Thanks again


:

Your XPath expression is incorrect; that is what the error means.
What field
are you using as the value for your dropdown? That is the field you
need to
set equal to current().

Finding the correct XPath expression can be a challenge. Without
knowing the
structure of the XML produced by the drop-down, it is virtually
impossible to
tell you what the correct expression should be.

Basically, you need to find the correct XPath to the ID field in
the
dropdown and set this equal to current().
---
S.Y.M. Wong-A-Ton


:

I poked around some more and here is something I found that I
thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look
like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID
=
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path
of a field
or group.

What am I not undertanding?

:

Yes, the article uses a repeating table. And current() is used
when using a
repeating table.
---
S.Y.M. Wong-A-Ton


:

I will give it a try but I am trying to do in a repeating
table so I hope the
same theory applies



:

Art, check out the section "Automatically display the
player's number and
position" in this article
http://enterprise-solutions.swits.n...-dropdown-list-repeating-table&c=infopath2003

You need to do something similar using the current()
function.
---
S.Y.M. Wong-A-Ton


:

I am writing this in the hopes that someone here comes up
with answer before
I figure this out.

Two data sources -
Main Connection is a table with fields A1, A2 and A3
Secondary Data Connection - S1,S2, S3

I created a repeating table to display A1, A2 and A3. I
changed A1 to a
drop down box and populated the drop down by binding it
to the Secondary Data
Connection. Therefore the drop down displays the data
elements in S1.

What I am trying to accomplish is when a selection is
made in the drop down
A1, A2 and A3 get populated with the data from S2 and S3.

Everything I have tried populates A2 and A3 with just the
first row of the
Secondary Data Source and does not change based on the
drop down selection.

Can someone point me in the right direction?

Thanks
 
S

S.Y.M. Wong-A-Ton

Thanks, Art.
---
S.Y.M. Wong-A-Ton


Art said:
Glad you are back

Your input here was missed


S.Y.M. Wong-A-Ton said:
Sorry for the delay in responding; I was away for a while. I'm glad you
finally solved it. And thank you for your suggestion. I'll update the
article
as soon as I get a chance, since I've also come to realize that screen
shots
do provide more clarity.
---
S.Y.M. Wong-A-Ton


Art said:
GOT IT!!!!!!!!!

S.Y.M. Wong-A-Ton - if I can make a suggestion

In your document tutorial, a second or third screen shot for steps 13 and
14
woudl be helpful for others.

Thanks for all your help.

:

I have continued to work diligently on this and think I am getting
close

My rule now says @Inventory = @Inventory[@ItemNumber = current()]

The field @Inventory gets populated but instead of returning the number
from
tblpromoitems it is returning a "false" value.

Am I close?





:

Let me try to provide a little more detail. I wish screen shots
could be
posted here.

My repeating table is bound to
/dfs:myFields/dfs:dataFields/d:tblPromoItemsordered. I display
ItemNumber,
Description, WebSite, Telephone, Quantity and Inventory. This is my
Main
Connection.

I changed Description to a Drop Down and pull data from a secondary
datasource with these properties
/dfs:myFields/dfs:dataFields/d:tblPromoItems (secondary connection)
where the
value is @ItemNumber and the display is @description.

This all works well and the drop down displays the values of
decription from
tblpromoitems.

Now I want to populate the remaining fields in that row that come
from the
row in the table tblpromoitems. I will use Inventory as an example.

On the Description field I set a rule that says for Conditon - If
ItemNumber (main connection) = ItemNumber (secondary connection), I
set a
fields value. The field is
@inventory (main connection) and I set the value to
@Inventory[@Inventory=current()] where the first @inventory is from
tblpromoitemsordered (main connection) and the second @inventory is
from
tblpromoitems (secondary connection). I also tried
@Inventory[@Description=current()] and
@Inventory[@ItemNumber=current()]

Nothing ever populates in Inventory.

I hope this give you some more detail to provide advice.

Thanks again


:

Your XPath expression is incorrect; that is what the error means.
What field
are you using as the value for your dropdown? That is the field you
need to
set equal to current().

Finding the correct XPath expression can be a challenge. Without
knowing the
structure of the XML produced by the drop-down, it is virtually
impossible to
tell you what the correct expression should be.

Basically, you need to find the correct XPath to the ID field in
the
dropdown and set this equal to current().
---
S.Y.M. Wong-A-Ton


:

I poked around some more and here is something I found that I
thought I
understood.

I followed the tutorial at
http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

and got lost at this point:

The tutorial says to append to the XSL statement to make it look
like this
xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID
=
current()]

Mine looks like this to begin with

xdXDocument:GetDOM
"tblPromoItems")/dfs:myFields/dfs:dataFields/d:tblPromoItems/@Inventory

I tried appending [../@inventory = current()]
but always get errors on does not point to a valid location path
of a field
or group.

What am I not undertanding?

:

Yes, the article uses a repeating table. And current() is used
when using a
repeating table.
---
S.Y.M. Wong-A-Ton


:

I will give it a try but I am trying to do in a repeating
table so I hope the
same theory applies



:

Art, check out the section "Automatically display the
player's number and
position" in this article
http://enterprise-solutions.swits.n...-dropdown-list-repeating-table&c=infopath2003

You need to do something similar using the current()
function.
---
S.Y.M. Wong-A-Ton


:

I am writing this in the hopes that someone here comes up
with answer before
I figure this out.

Two data sources -
Main Connection is a table with fields A1, A2 and A3
Secondary Data Connection - S1,S2, S3

I created a repeating table to display A1, A2 and A3. I
changed A1 to a
drop down box and populated the drop down by binding it
to the Secondary Data
Connection. Therefore the drop down displays the data
elements in S1.

What I am trying to accomplish is when a selection is
made in the drop down
A1, A2 and A3 get populated with the data from S2 and S3.

Everything I have tried populates A2 and A3 with just the
first row of the
Secondary Data Source and does not change based on the
drop down selection.

Can someone point me in the right direction?

Thanks
 

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