PHi Bubble community,
I’m struggling with saving multiple items from an API response into a database list field and could use some guidance.
My Setup:
Database:
-
Table:
MyDataType -
Field:
my_list_field(type: list of option sets) -
Option values include:
option_a,option_b,option_c, etc.
API Connector:
-
External worker that returns parsed data
-
Response includes a
my_list_fieldfield -
Currently configured as “option set” in API Connector
API Response Example:
my_list_field: "option_a,option_b"
(comma-separated string with values that match my option set)
The Problem:
When I try to save this to my database using:
Make changes to MyDataType
my_list_field = This MyDataType's my_list_field:merged with
Result of step X's my_list_field:converted to list
What happens: Both items get saved as ONE concatenated item: option_aoption_b
What I want: Two separate items in the list: option_a AND option_b
What I’ve Tried:
-
Returning an array from the API (Bubble sees it as “list” but still doesn’t split properly)
-
Using
:split by ","(option not available when field is option set) -
Using
:converted to list(concatenates items instead of splitting) -
Changing API field type between “text”, “option set”, and “list”
Questions:
-
What’s the correct way to configure the API Connector return field for this use case?
-
What expression should I use in the workflow to properly split and save multiple option set values?
-
Should the API return a string, an array, or something else?
Any help would be greatly appreciated! I’ve been going in circles for hours.
Thanks in advance!