mo13
March 30, 2023, 11:51am
1
Hello Bubble Community.
I need to to send data from a state to a external API.
The list set of state “table_items” looks like this:
product-id: number
quantity:number
price: number
In the next step I want to make a POST Request with the list “table_items”
At the Moment it looks like this
The Output:
{ “product_id”:“123,3044,4030”,
“quantity”:“1,2,1”,
“price”:“123.45,10.90,30.15”,
},
I need the output to look like this:
{ “product_id”:“123”,
“quantity”:“1”,
“price”:“123.45”,
},
{ “product_id”:“3044”,
“quantity”:“2”,
“price”:“10.90”,
},
{ “product_id”:“4030”,
“quantity”:“1”,
“price”:“30.15”,
},
Thank you for your time.
you will find :format as text to be your friend here. within your square brackets for the array, you’ll enter your search and then :format as text
the result. in the output formatter you’ll enter your JSON schema for the objects in the array. Check out this example.
so instead of Search for Calendar Events:format as text
, yours would be table_home's table-items:format as text
mo13
March 30, 2023, 1:47pm
3
You saved my day. Thank you very much. How can return the favour?
PS: It worked also without “formatted as JSON-safe” Is it still necessary?
1 Like
not nescessarily! depends on the data being sent in the array. feel free to mark my response as a solution
1 Like