none
Infopath Binding to Lookup Fields Text Value RRS feed

  • Question

  • I have a SP 2010 list that has a lookup column along with additional look fields. I want to present the individual items display and edit form using infopath and show the lookup items value field in a textbox or calculated field, not a dropdown list. However, all I get is the ID field value not the text value. How can I accomplish this without playing the extra column game.

    Ken

    Wednesday, March 9, 2011 1:45 PM

Answers

  • I gave this a whirl, try this:

    Setup:

    List: ListX, columns: ID, TitleX, ListYID (lookup to ListY, on ID)

    List: ListY, columns: ID, TitleY

    Create InfoPath edit form on ListX

    This creates a form with 2 fields:

    TitleX [Textbox]

    ListYID [Lookup]

     

    If you look at the data source, it created a secondary datasource for ListY.  But unfortunately this doesn't bring in the other columns - only ID, and it looks like I can't modify it either.

    Create another secondary data source to ListY (ListY2), include both ID and TitleY

     

    Copy and paste the dropdown for ListYID lookup - now you have 2 lookups bound to ListYID, InfoPath will warn but not error.

    change the datasource for the 2nd dropdown to ListY2 datasource, value = ID and display = TitleY

    I also added a formatting rule to make it disabled.

     

    Quick publish the form and you can see changing field 1 updates the display in the second lookup.  

     

    I personally think it's far easier to just use additional columns when you set up the lookup in the first place.  I tried also using an expression box but InfoPath listforms refuse to bind to a secondary collection, strangely...

     

     

     

     

     


    jliu - johnliu.net - sharepointgurus.net
    • Marked as answer by Stanfford Liu Thursday, March 17, 2011 7:21 AM
    Monday, March 14, 2011 1:09 PM