Troubleshooting List Box Data Connection

I

InfoPNewb

I have a dropdown list box in a repeating section of an InfoPath 2003 form.
The field is linked to a SharePoint 2007 list with a Description column
(single line text) and a Value column (number field). Each record in the
SharePoint list has a unique Description entry but several have the same
number in the Value field. I created a secondary data connection in InfoPath
and linked the SharePoint Description column to the Display Name field of the
InfoPath drop-down list box and the Value column to the Value field of the
list box. The problem is that when I select a description from the drop-down
list, it jumps to a different item that has the same Value entry as the one I
selected. I need the Value entry for a calculation in another field in the
InfoPath form but I still need to see the chosen Description in the drop down
list. Any suggestions?
 
E

Ed Thurber

i think the problem is that infopath is looking for the first "display" that
is paired with "value". recommend setting the display and value fields of
the dropdown to the Display Name column and then set another field in your
datasource to the value in the value column by specifying a default value of
ValueCol[DispNameCol = ElementAttachedToListBox]
(the part in the [] is a WHERE clause. this reads "the value in the
ValueCol WHERE the value in the DisplayNameCol equals the value selected in
the dropdown")

hope this makes sense

Ed
 
I

InfoPNewb

Thanks for the reply Ed!

As a non-developer, I’m flying by a wing and a prayer here. I understand
the logic of the formula you provided. I’m just not sure how to implement
it. As you suggested, I changed the Value and Display Names for the drop
down to the Description Column in the secondary SharePoint data connection
and created a separate text box for the value field. Here’s how I attempted
to create the formula in the default value of the text box - without success:

“ValueCol†(I selected this field from the secondary data connection to the
SharePoint list)

“DispNameCol†(Also selected from the secondary data connection to the
SharePoint list)

“ElementAttachedToListBox†(For this one, I just selected the drop down
field from the form)

What did I do wrong?


Ed Thurber said:
i think the problem is that infopath is looking for the first "display" that
is paired with "value". recommend setting the display and value fields of
the dropdown to the Display Name column and then set another field in your
datasource to the value in the value column by specifying a default value of
ValueCol[DispNameCol = ElementAttachedToListBox]
(the part in the [] is a WHERE clause. this reads "the value in the
ValueCol WHERE the value in the DisplayNameCol equals the value selected in
the dropdown")

hope this makes sense

Ed

InfoPNewb said:
I have a dropdown list box in a repeating section of an InfoPath 2003 form.
The field is linked to a SharePoint 2007 list with a Description column
(single line text) and a Value column (number field). Each record in the
SharePoint list has a unique Description entry but several have the same
number in the Value field. I created a secondary data connection in
InfoPath
and linked the SharePoint Description column to the Display Name field of
the
InfoPath drop-down list box and the Value column to the Value field of the
list box. The problem is that when I select a description from the
drop-down
list, it jumps to a different item that has the same Value entry as the
one I
selected. I need the Value entry for a calculation in another field in
the
InfoPath form but I still need to see the chosen Description in the drop
down
list. Any suggestions?
 
E

Ed Thurber

go to the properties of the new element you created to hold the "Value"

find the Default Value field. and click the Formula button to the right.

on the Insert Formula dialog box, click Insert Field or Group

On the Select a Field or group dialog, select your secondary data source
from the dropdown.

Expand the nodes until you see your "value" field. and select it (single
click).

at the bottom of the dialog box there should be a Filter Data... button.
click that button.

here you will add a filter by clicking add.

In the filter criteria set the first field to the description field in your
secondary datasource.
the second field shoud be "is equal to"
the third field should be set to the element in your main datasource that is
bound to the dropdown.

click OK serveral hunderd times.

your default value should look something like this

@Customer_Name[@Ship-to = ShipTo] (with diff element names, this is from a
form I am working on.)

yours may look more like this @value[@description = description]

hope this helps

InfoPNewb said:
Thanks for the reply Ed!

As a non-developer, I'm flying by a wing and a prayer here. I understand
the logic of the formula you provided. I'm just not sure how to implement
it. As you suggested, I changed the Value and Display Names for the drop
down to the Description Column in the secondary SharePoint data connection
and created a separate text box for the value field. Here's how I
attempted
to create the formula in the default value of the text box - without
success:

"ValueCol" (I selected this field from the secondary data connection to
the
SharePoint list)

"DispNameCol" (Also selected from the secondary data connection to the
SharePoint list)

"ElementAttachedToListBox" (For this one, I just selected the drop down
field from the form)

What did I do wrong?


Ed Thurber said:
i think the problem is that infopath is looking for the first "display"
that
is paired with "value". recommend setting the display and value fields
of
the dropdown to the Display Name column and then set another field in
your
datasource to the value in the value column by specifying a default value
of
ValueCol[DispNameCol = ElementAttachedToListBox]
(the part in the [] is a WHERE clause. this reads "the value in the
ValueCol WHERE the value in the DisplayNameCol equals the value selected
in
the dropdown")

hope this makes sense

Ed

InfoPNewb said:
I have a dropdown list box in a repeating section of an InfoPath 2003
form.
The field is linked to a SharePoint 2007 list with a Description column
(single line text) and a Value column (number field). Each record in
the
SharePoint list has a unique Description entry but several have the
same
number in the Value field. I created a secondary data connection in
InfoPath
and linked the SharePoint Description column to the Display Name field
of
the
InfoPath drop-down list box and the Value column to the Value field of
the
list box. The problem is that when I select a description from the
drop-down
list, it jumps to a different item that has the same Value entry as the
one I
selected. I need the Value entry for a calculation in another field in
the
InfoPath form but I still need to see the chosen Description in the
drop
down
list. Any suggestions?
 

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