Hello, I’m trying to find a workaround to send a list of data to an external custom API (i.e. AWS Lambda function). Simplified scenario: for each User I have height and weight. Suppose I want to for some users get their BMI = weight/height^2 via my external function:
POST(JSON={[list of weights], [list of heights]}) → API → Response ([list of BMIs])
(I have a much more complex computation than this but it illustrates the issue). Visually, here is what I need:
What I’ve tried:
- In a workflow I can retrieve the response by for example setting for some custom state =
Get data from external API →
listofweights= Search for users that fit criteria : formatted as text : text is each user’s weight : comma delimiter
listofheights= Search for users that fit criteria : formatted as text : text is each user’s height : comma delimiter
This does not work, and I’m hunting for a workaround to sending a (variable length) list of data to an external API.
For context: there’s a bug in Bubble. If you do the above process on the page i.e. a dynamic text in a text box, it works absolutely as intended. If you do it in a workflow, then the first text calculated will overwrite all the rest (reproducible example). Flagged to Bubble, but I need to find a workaround urgently and I haven’t heard back from them yet.
Edit: I should have specified: there’s a simple method where you do Search by users → 's height → join with “,”.
I do that method when I just need to send a simple list, problem arises when I need to send lists of lists. For example if each User has a field “visited locations”, and I want to send:
[[Japan; France], [USA; UK; Japan], … ]
Etc. Then I have to do two nested layers (i.e. first is list of users: formatted as text (delimited “,”), then for each user get all visited locations, format this as text (delimited “;”)) . The simple method (search for all user’s visited locations → formatted as text (delimited “;”)) results in:
[Japan; France;USA; UK; Japan; … ]