How to send option from option set as parameter from API Connector?

I have an API Workflow with a parameter whose type is an Option Set. I need to configure an API Call from the API Connector to the workflow. I don’t find any way to successfully include an option from the Option Set for the relevant parameter. The workflow returns an error response such as “Invalid data for key [workflow parameter key name]: could not parse this as a [option set name]”.

I tried:

  • The option’s display value (e.g., My Campaign).
  • The value that I see in the server logs (e.g, my_campaign) when a Schedule an API Workflow action successfully schedules the workflow.

Is this possible to accomplish?

Hmm :thinking: Can you send the data just as text? If you need to find the data you can do a filter on the option set. Does that work?

That occurred to me and would presumably be a functional workaround. I’m seeking first whether there’s a solution that doesn’t require reconfiguring all my Schedule API Workflow actions that already just send the native option.

When I used option sets, I noticed that sometimes there would be an issue if you changed the name of the option set. So I do believe you should use a text to be safe. As an alternative, you can do a bug report and see if Bubble might fix the issue. :blush: Unless someone else might have another idea.

Never mind! Using the option’s display value does work. I must have made some other mistake when I originally tried that. I’ve just now tried again with success.

FYI, what led me to try again was that I started to contact Bubble Support to request a definitive answer, and when I got initially routed to their AI bot its response was to try using the display value. Following is my conversation with the bot.

In a request to an API Workflow, what value should I use to represent an option for a parameter whose data type is an option set?

I’m not entirely certain, but to represent an option for a parameter whose data type is an option set in a request to an API Workflow, you would typically use the unique identifier or the display value of the option you want to set. If you’re sending data to Bubble’s server, this value should be included in the body of the POST request or as a querystring if specified. For example, if you have an option set for colors with options like “Red”, “Blue”, and “Green”, you would use the specific identifier for “Red” if that’s the option you want to select. Could you provide more details on the option set and the context in which you’re using it? This would help in giving a more precise answer.

What is an option’s unique identifier? Is that different than its Display Value?

An option’s unique identifier is not explicitly mentioned as being different from its Display Value in the provided information. However, the Display attribute is used to store the main identifier of each option, such as the name of a state, and it is not required to be unique. This suggests that while the Display Value can serve as an identifier, it may not be the unique identifier, especially if there are duplicate Display Values. It’s recommended to ensure Display Values are unique if you need to filter options by their Display Value later to avoid unexpected results.