Concat 2 SQL Columns in InfoPath Drop Down List Box - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Concat 2 SQL Columns in InfoPath Drop Down List Box

Last post 05-23-2019 09:57 AM by Hilary Stoupa. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-07-2013 01:59 PM

    Concat 2 SQL Columns in InfoPath Drop Down List Box

     Hi,

     I am trying to query a single SQL Table and obtain the values FirstName and LastName (columns in the SQL Table). How would I go about concating FirstName and LastName inside the Drop Down List Box WITHOUT USING A REPEATING TABLE OR SHAREPOINT LIST AS A 'MIDDLE MAN' I believe this is achievable through the SQL statement itself but I'm not having any luck with it.

     

    Thank you in advance for any helpful input!

     

     

  • 08-11-2013 12:46 PM In reply to

    Re: Concat 2 SQL Columns in InfoPath Drop Down List Box

    You will have to modify the view's XSLT. To extract source files (including the XSLT) from your InfoPath form template, go to Form->Publish->Extract Source Files. Specify a folder. Now you can go into your view's XSLT file (typically View1.xslt), find the dropdown and use xpath concat command to create a composite dropdown.

    I believe Greg Collins has a sample that does this - search for "dropdown concat manual XSLT edit" or something like that. It's not hard to do and this should not require an xdPreserve block (used to prevent InfoPath designer from not round-tripping the manual edits). In other words, you should be able to round-trip it using the InfoPath Designer.

    I know this topic has been discussed in this forum before so please search for it. If you can't find it, let us know.

    Patrick Halstead
    Project Manager at Qdabra
  • 05-23-2019 08:43 AM In reply to

    • jvazquez
    • Not Ranked
      Female
    • Joined on 05-07-2019
    • Massachusetts
    • Posts 10

    Re: Concat 2 SQL Columns in InfoPath Drop Down List Box

     Hi Patrick, I am trying to find the sample using the search you reference but I am not getting any results back.  I would like to accomplish the same thing outlined in this post.  Can you help me find the information?

  • 05-23-2019 09:31 AM In reply to

    Re: Concat 2 SQL Columns in InfoPath Drop Down List Box

    Hi - what is your data source for your dropdown? Is it SQL or SharePoint? The approach mentioned here involves modifying the form's source files for populating the dropdown with a concatenated value which I really don't recommend if there are other alternatives. If your data source is a SharePoint list - the easiest thing to do would be to add a calculated column in your list that combines the data in the way you want.... then use that column for your display.
    Hilary Stoupa

  • 05-23-2019 09:41 AM In reply to

    • jvazquez
    • Not Ranked
      Female
    • Joined on 05-07-2019
    • Massachusetts
    • Posts 10

    Re: Concat 2 SQL Columns in InfoPath Drop Down List Box

     Forget it, I was able to get my IT to take a look and they had me combine both fields through a SQL query in the data connection.

  • 05-23-2019 09:43 AM In reply to

    • jvazquez
    • Not Ranked
      Female
    • Joined on 05-07-2019
    • Massachusetts
    • Posts 10

    Re: Concat 2 SQL Columns in InfoPath Drop Down List Box

     Thanks Hilary, I am pulling the data from SQL and I had my IT take a look and they found it could concatenated through a editing the SQL in the data connection.

  • 05-23-2019 09:57 AM In reply to

    Re: Concat 2 SQL Columns in InfoPath Drop Down List Box

    Perfect, glad they were able to help. Another option sometimes instead of modifying the SQL connection is to use a SQL view that has the data combined. And in case future thread readers want to do this in the source files: https://www.infopathdev.com/blogs/greg/archive/2004/07/08/Display-Multiple-Fields-in-a-Drop_2D00_Down-List-Box.aspx
    Hilary Stoupa

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