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

Add comment



+1 BamaBob Friday, 15th May 2015, 8:16 pm
:lol: Works perfectly! Thanks.
+1 shiva Monday, 16th February 2015, 5:53 am
Thanks, That helps n saved my time
+1 Erfan M Wednesday, 14th March 2012, 7:10 am
when I open it as a form which opens in client application, work fine, but when I wanted to open it in web page it sorted by ID. what can I do with this
+1 Patrick S Tuesday, 31st July 2012, 2:51 pm

did you manage to find a solution to show the correct sorting in the web form?

+1 Inland_surfer Tuesday, 27th November 2012, 10:26 pm
I changed the default view for the dropdown datasource as a SharePoint list to sort by the column I want in the infopath form. It worked like a charm Thanks!
+1 Joel L Thursday, 15th March 2012, 1:08 pm
Hi Erfan,

I found that if you open your spreadsheet and then select view > modify this view then you can modify the default sort view there. This is the second dropdown in the right margin (top right of data) and below the "site actions" dropdown.

+2 Omid Z Wednesday, 24th October 2012, 10:08 pm

I am having the same issue as Erfan. I followed your instructions and even though i sort the list by a different field, in my web form dropdown it still sorts by id.
+1 Joel L Friday, 26th October 2012, 9:39 am
Hi Erfan,

Sorry for the delay. My team decided not to use InfoPath as a solution and as such, my access to a test system has been limited. I will have a look again when I get the chance post a solution when I find one.
+1 amanda Thursday, 16th February 2012, 3:18 pm
Joel - sadly this does not work for me.
+3 Mike P Tuesday, 22nd November 2011, 4:55 pm
I was struggling with this as well, then I checked the Data Connection to receive the values and there is a sort option on the data connection.

Too simple!

+2 Nerfe Friday, 24th August 2012, 2:44 am
Hi Mike,

Are you refring for Infopath 2007 or 2010? In 2007 I cannot see sort option.