What is the best way to get the ID of drop down options?

I’m looking to create a program that updates many records at once in my contacts database. I currently have three single-select fields that I’d like to map responses to.
When I get the schema via api, it does not appear to include the drop-down “sub-types.” I’d like to expedite finding the associated IDs for each of the options in all three drop downs.
Any recommendations of best practice here?

The options for a single select are in effect entities of the single select database (a.k.a. type) so querying the schema will not get you them. You need to do an entity query to find out the ids of each option.

Thanks @Chr1sG
I was having trouble querying for the dropdowns but tried the Fibery type instead of the fibery/name value and was successful. Example below for people in the future:

{
      "command": "fibery.entity/query",
      "args": {
        "query": {
          "q/from": "${app}/${dropdownName}_${app}/{$typeName}",
          "q/select": ["fibery/rank","enum/name","fibery/id"],
          "q/limit": 10
        }
      }
}
1 Like

I’ve struggled with this before too. I had to look at the incoming HTTP requests from Fibery to find the UUID’s of options in various dropdowns/selects.

It would be handy if there was some [Item UUID] argument for formulas. That way we could easily just create a temporary field to copy the ID when opening the field. That or some keyboard shortcut to hold while clicking on an option to copy its UUID to clipboard—or perhaps some hidden field for when you hold ALT and click “New Field or Relation”

2 Likes

I guess you’ve probably have thought of it, but you could make text field (called UUID) and define a scheduled automation to get the ID. Then just ‘Run now’ to populate all of them at once:

1 Like

This is quite creative. I think it’s a great way for people who are not using the API to extract the information.

Hey Chris, has a method for listing all available UUIDs for select fields/state fields been added to the official documentation?
I’m having some trouble navigating it so it’s possible they have and I couldn’t find the documentation.

Adding in case someone is googling how to get the Fibery ID of all options for a State field:

{
      "command": "fibery.entity/query",
      "args": {
        "query": {
          "q/from": "${fibery/Type}",
          "q/select": ["fibery/rank","enum/name","fibery/id"],
          "q/limit": 10
        }
      }
}

Fibery’s Type name for state fields follows the schema workflow/state_{$app}/{type}

Not sure what you’re looking for - the explanation about select fields (enums) is on this page:
https://the.fibery.io/@public/User_Guide/Guide/Field-API-263

Thanks for the link. Unfortunately It’s not there.
As this post suggests sometimes it is necessary to get the ID’s of all the options for a collection field. It’s possible to find this information by querying the API but there is no mention of how to do so in the documentation.
Seems like a bit of an oversight. Can this be added?

So, the options are entities, and getting their uuids (or any property for that matter) is just a case of using the standard entity query (as you showed in your example post above).
The only thing that differs from ‘normal’ entities are the things that are specific to enums (how the type is named, and what its field titles are) which is what is covered in the link I just shared.

So can the documentation be update to be clear and to include the examples above?