Way to POST list of things as a list (not string)

Anyone know how to POST a list of things as a proper list? Bubble converts the list to a string by default which is throwing off rows.

Example, I want to post two columns from the table “cart”

image

Bubble is converting the list of items to one concatenated string which doesn’t work because I cannot know what’s Fruit, what’s skittles.

Anyone know how to force the list to remain a list? Something like this syntax?

If the data-type is a list you need to wrap it in single brackets: [“item1”, “item2”].
You cant do that twice like you do, so this is not valid: [“item 1, item 2”], [“item3”, “item4”]

So basically it would like like below:

{
    "Category_Single": "This is a category",
    "Category_List": ["category_1", "category_2"],
    "Item_Single": "This is an item",
    "Item_List": ["FirstSearch", "SecondSearch"]
}

Be aware that if your are referencing and item, say you have a product type of “apple” that you reference in your list, that item needs to exist, otherwise your post request will fail. You then need to reference the full id.

  {
        "Category_List": ["category_1", "category_2"],
        "Item_List_referenced": ["12345x54321", "422313x435252"]
  }

Etc.

Hope that helps
Simon

With your idea, I’m only able to post one record at a time correct? Only Fruit or only Skittles, but not both in the same post?

Ahh, your talking about a post command with bubble api connector. I thought you were trying to use post (from an external app/postman) to create an item.

Could you create your json object in a hidden text element and use that in the api connector?

They have a few plugins For advanced json

Right, I’m POSTing this from Bubble to an external endpoint using the backend workflows so unfortunately, I cannot create json on the page to handle the formatting.

I think need a plugin that can create nested json …
playing with this plugin…https://bdkdemos.bubbleapps.io/bdk_utils_transform_list