Retrieve display name of selection in lookup field - InfoPath Dev
in

InfoPath Dev

Retrieve display name of selection in lookup field

Last post 08-01-2017 06:47 AM by GreenSun. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-24-2017 09:07 AM

    Retrieve display name of selection in lookup field

    I have an InfoPath form with a repeating table, which populates a SP list (list1). All fields I'm talking about are in the repeating table (in case that matters).

    One of the fields is a lookup field, which retrieves its options from another SP list (list2).

    I would like to set the default value of a text field in list1 to the *display name* of the selection in the lookup field. I only managed to get the text field to show the *value* (some number).

    Can that be done at all?

    (Background: I would like to offer the user a choice for that text field based on values from list2, but at the same time leave the freedom to change that text to something entirely different. The content of list2 is also dynamic, which means I can't use some term store solution. To that end, my idea was to offer the lookup field and then transfer its display name to the text field, where the user can leave or modify it as needed. If you have a completely different suggestion as to how I can achieve my goal, I'd also be happy to give that a go!)

    Here's the layout of the SP list system (leaving out many more irrelevant columns)

    List1 "Meeting"
     Date "Date"
     Choice "Type"
     Calculated "Date_and_Type" = Concatenate([Date];" ";[Type])

    List2 "Agenda"
     Lookup -> Meeting.Date_and_Type
     Text "Title"

    List3 "Minutes"
     Lookup -> Meeting.Date_and_Type
     Lookup -> Agenda.Title
     Text "Topic" 

  • 07-31-2017 08:23 AM In reply to

    Re: Retrieve display name of selection in lookup field

     So there should be a secondary data connection in your form that provides values to the lookup. You can use a default value in another field where the default is:

    • Select the field from the secondary data source that provides the "display"
    • Click on filter data
    • For the filter - ID in the secondary data source = the field in the main data source that is bound to the lookup
    • Verify that IP was smart enough to use the current() function in the filter.

    If you need a hand, attach a copy of your form under the options tab in a reply. 

    Hilary Stoupa

  • 08-01-2017 06:47 AM In reply to

    Re: Retrieve display name of selection in lookup field

    Only one word: WOW!

    Your solution was absolutely spot-on! Not only could I solve this specific problem, I also learned more about making use of the different data connections. And because there was a slight quirk when I tested this (once the user changed the field, IP would overwrite it with the standard value when the table row was e.g. moved) I also learned how to use a rule.

    Thank you very much! 

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.