How To Alphabetize List In Dropdown From Airdata

Hi,

Looking to pull in a list for a dropdown from Airdata, but need the list to be in alphabetical order.

I have a “list of any” that creates the dropdown correctly. The field that needs to be ordered is “Accountname”.

Under “FROM”, does this variable need to be defined in the webflow?
image

Hey Chris! what does accountlist look like?

You can order objects in an array by using something similar to what you have and using ASCENDING or DESCENDING

So if i have airData.results that looks like this:

[
    {
      "__id": "",
      "Name": "test"
    },
    {
      "__id": "",
      "Name": "hey"
    },
    {
      "__id": "",
      "Name": "life"
    }
  ]

Then i would do something like this to get them to alphabetized.

FROM
  item
IN
  airData.results
ORDER BY
  item.Name
ASCENDING
SELECT
  item

Here is my list. I run a query to get the account names and then transform to only have the account names.

image

image

If accountlist is just the array of companies, then you can just do something like:

FROM
  item
IN
  accountlist
ORDER BY
  item
ASCENDING
SELECT
  item
1 Like

Works great, thanks!