By default Connections will sort by last name [organization name, family name], first name in descending alphabetical order. The order_by attribute can be used to apply a custom sort order. Here are the available sort fields and order flags that ca be used.
Multiple sort fields can be used by separating them by commas. You can also add the order flag to each sort field to list the results in ascending or descending order. The sort flag is entered right after the order field separated by a ‘pipe’ | . This character is usually placed above the ENTER key and typed by hitting SHIFT + BACKSLASH keys.
/* * Example 1 * Sort by state in ascending order and then zip code in descending order. */ [connections order_by='state|SORT_ACS,zipcode|SORT_DESC'] /* * Example 2 * Sort by entry ID but list them exactly in the order as entered in the id attribute. */ [connections id='5,401,10,36' order_by='id|SPECIFIED'] /* * Example 3 * Sort all results randomly. */ [connections order_by='id|RANDOM'] /* * Example 4 * List the supplied entry IDs but order them randomly. */ [connections id='5,401,10,36' order_by='id|RANDOM']