Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sorting Value Lists

Featured Replies

I am working on an application for garments and I want to use a drop down list in the user interface for garment sizes. My problem is mostly aesthetic in that I cannot figure out a way to sort the sizes into the logical order they come in. I need to use related records because the sizes vary depending on the garment, so using custom values doesn't work, though in my example I use one to show what I am hoping to accomplish. Any ideas ?

Size_Example.fp7.zip

With a short value list (up to around 100 values) you could use something like this.

Note that the SortBy field should be a calculation, but I don't have the time to do it now.

Size_ExampleMod.fp7.zip

  • Author

Brilliant! Thanks. I knew it had to be something like that, but it has escaped me.

  • 2 weeks later...

Comment,

I've run into pretty much the same problem, with a slight variation... The field in question (using a Pop-Up Menu) needs to store a foreign key that the user shouldn't see. Therefore, my value list (based on a related table) is set to only display values from a 2nd field (eg. department), which is something more descriptive to the user. I believe this is pretty standard operating procedure in FM development.

Problem is, it seems to me this doesn't really leave any way to sort the value list using a method similar to the one you've given. Once I select the option to "Show values only from second field" I only have one option of field to sort by, and since that's the field that I want the users to see, I can't very well use invisible spaces in that field. I need an option for a 3rd field ;)-)

One solution I've thought of is to NOT use the foreign key as the 1st field of the value list, and instead use the descriptive field. I could then use your sorting method, and then when the user saves the record, use a script to set the foreign key based on the chosen value. I wouldn't normally like to do something like this, but in this particular case it might be OK.

Any other suggestions?

Thanks in advance

Jason

Value lists are a simple solution to a simple problem. I'd suggest you graduate to a more flexible method, such as scripted selection from a portal or from a list view in a new window.

Yeah, I'm familiar with those other options, but I was really hoping to just find some way to use a value list in these cases where I'm dealing with a very small record set for the value list.

Anyway, I appreciate your reply.

There's nothing that you haven't already discovered, I'm afraid. If you like, you can make the department name serve as the key - with the inconvenience of handling a potential name-change by a script.

I have been struggling with this too - want to use the value list in a drop down but sorted - not alphabetically.

Closest I have found is to reverse the order of the fields in a value list so that the sort field is the second field displayed. By making the sort field a long series of blanks with the sort number appended at the end then the sort number doesn't appear within the field on the layout - though it does appear within the drop down which still looks ugly.

I feel there must be an obvious answer out there somewhere ...

Have you read the entire thread?

Ah, got it now. Couldn't see the spaces in your sort field. But now it works. Thanks.

Couldn't see the spaces

That's kinda the idea behind this. :P

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.