Concatenating SharePoint fields into one InfoPath field drop-down? - InfoPath Dev
in

InfoPath Dev

Concatenating SharePoint fields into one InfoPath field drop-down?

Last post 06-22-2010 03:51 AM by elizas. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-29-2007 03:10 PM

    Concatenating SharePoint fields into one InfoPath field drop-down?

    I've been able to have the user select a job number which automatically populates the job title and work location fields for a job app form. In this scenario, the user has to remember what the specific job number is for the position they're applying for. To make this easier, I tried a calculated field in SharePoint to combine the job number, position title, and work location. Unfortunately, Infopath doesn't see this field as a choice from the data source.

    So far, I've only been able to concatenate the first item in a drop-down. I was even able to show all the concatenated fields, however, still only for the first item in the drop-down. Has anyone been able to successfully combine three SharePoint fields into one browser form drop-down field?

    I saw these links that helped me get closer but not quite there yet:

     http://blogs.msdn.com/infopath/archive/2006/04/05/569338.aspx

    http://www.infopathdev.com/forums/p/844/1563.aspx#1563

    I'm using the following rule which dumps everything into the first item of the drop-down for me:

    eval(eval(Open_Positions, "concat(@Job_Number, @Position_Title, @Work_Location)"), "..")

    Any help you can provide would be much appreciated.

    Thanks!

    -Gil

  • 01-03-2008 07:08 AM In reply to

    Re: Concatenating SharePoint fields into one InfoPath field drop-down?

    Hi gilstmaria,

    It's awful that you can't see those Calculated fields from InfoPath, isn't it?!  The only thing I can think of doing without using code (which seems a requirement in your scenario to support browser forms) is to use three cascading drop-downs instead of one with everything crammed into it.  This is what was done in the second thread that you posted.

    If you search the forums and our website for "cascading drop-down list" you should be able to find plenty of information on implementing this.

    Hope this helps!

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-03-2008 07:37 PM In reply to

    Re: Concatenating SharePoint fields into one InfoPath field drop-down?

    Thanks for the tip Matt, but I already have that working. The reason why we need to have everything crammed together (or concatenated) is to make it easier for the user to see what the relationship is between the job number, job title, and job location.

    The closest I've gotten is to use a Rich Text Field with the following rule:

    eval(eval(Open_Positions, 'concat(@Job_Number, ": ", @Position_Title, ": ", @Work_Location, xdXDocument:GetDOM("characters")/characters/@cr)'), "..")

    It's not selectable, but at least the user can see how each of the fields are related.

    I'm not opposed at all to using code to give me one drop-down list with everything crammed together if you happen to have a code sample I can follow.

    Thanks again for your reply.

    -Gil

  • 06-22-2010 03:51 AM In reply to

    Re: Concatenating SharePoint fields into one InfoPath field drop-down?

    An example for binding / populating an ASP.Net DropdownList with the values from a SP Choice Field: "Rating", is provided below. 'get the List instance Dim leadLst As SPList = web.Lists("LeadList") 'get the choice field instance Dim fldRating As SPFieldChoice = CType(leadLst.Fields("Rating"), SPFieldChoice) 'iterate through each of the choice items to populate a dropdownlist For Each choice As String In fldRating.Choices Me.cmbRating.Items.Add(choice) Next Sharepoint migration india http://www.mindfiresolutions.com/Sharepoint-Consulting-Company.htm
    Cheers,
    Eliza
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.