Sort order a dropdown list in MS InfoPath without programming

So this is for Microsoft Office Infopath 2007 (SharePoint 2007).

The situation is that I started creating a SharePoint List (datasheet) and when I made my form dropdown read from the list, it just put elements in the order that I entered them in the datasheet.

Googling this led me to browse MSDN for an hour before I realised all those experts were using programming solutions that seemed a bit over the top for something that should be so simple.

Hey presto, I found a cheat/workaround:

  1. Click on the list to see your datasheet (has a MS Access icon in the top left to remind you what you're getting yourself into)
  2. Go to Settings
  3. Select Create View
  4. Select Datasheet View (you could probably use a "Standard View", I just used the Datasheet one)
  5. Give the view a name, select what columns you want the form to have (I included the IDs for functional purposes)
  6. Further down the "Create View" page, there should be a Sort section, specify the column to sort by.
  7. Save the view by clicking the OK button.
You'll be returned to your datasheet and it's possible it isn't in any different order. I re-checked out my InfoPath form, looked at the dropdown that was already configured to read off the sharepoint list, and it had re-ordered to what I set in the view!!! I don't really understand how it works only that it does. I think this could get complicated if you had two dropdowns reading off the same list but needed to list elements in different orders.

If you haven't made a dropdown list yet There's other instructions out there on the web but I thought I'd put what I did so that when I did the above it would all work:
  1. Open your form in InfoPath
  2. Go into Design mode
  3. Go to "Controls" and add a Drop-down List Box to your form
  4. Right-click it and select "Drop-down List Box Properties"
  5. Under "List box entries" select Look up values from an external data source
  6. Next to "Data source" click on Add
  7. Select "Create a new connection to" and then Receive Data
  8. Select SharePoint library or list
  9. Copy the URL/web address from your browser which has the datasheet open (eg. "http://your_sharepoint_server_name/Lists/your_list_name/Allitemsg.aspx")
  10. Select the name of your list (I know I thought we already did this but hey ho)
  11. Select the fields of this list you want to use (only really need ID and Name or just the one if your dropdown values will be the same as the display labels)
  12. Next > Next > Finish
My Google Searches (ignore this, it's for me):
  • infopath look up values sharepoint list sort by
  • order drop-down list box without/no programming code

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Related Articles

Joes Revolver Map

Joes Word Cloud

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2021 Joel Lipman .com. All Rights Reserved.