To follow up. Any chance this will be implemented soonish? I can add recipients one by one however it will be sorta killing the workflow if other users of my app will do the same.
That’s alright. I’ll sort it out another way. (I hope)
Speaking of which: How can I send a list of things to Blockspring so it fills in as a table?
Right now if I run a block: “Append values to a Sheet”, I enter the following into JSON input: [[“List of things first_names”, “List of things last_name” ]]
RESULT:
Column A Column B
Row 1 Bernie, Hillary, Donald “Sanders, Clinton, Trump”
I can add one column of repeating group by entering JSON: [["List of Things first name joint with “],[” "]]
Column A
Row 1 Bernie
Row 2 Hillary
Row 3 Donald
How can I get Blockspring to enter it into the table with both first and last name like this:
Column 1 Column 2
Row 1 Bernie Sanders
Row 2 Hillary Clinton
Row 3 Donald Trump
(Or is this pretty much the same issue and I can’t do it?)
Hi @adycarlo, I can think of a couple of ways to do this.
1 . If you are initiating the send from a browser, and the user has access to all the data sending, could build up the list with the Toolbox plugin List Item Expression.
2 . If the API call is from an API workflow step, i.e. from the server, could send the following to an external host …
and have it return back a structured form
[
{ “email”: "[email protected]", “last_name”: “Jones”, “pet”: “Fluffy” },
“email”: "[email protected]", “last_name”: “Miller”, “pet”: “FrouFrou” },
…
}
How often does it need to run? If its infrequent, could use a free webtask.
3 . Build up the text for each item as it is created / updated.
Hi @emmanuel! I was wondering if this feature of inputting a list to the POST body will ever be added? I would love this feature and currently there is no seems to be no workaround sending a list of data to the API connector (or even converting a list to a string). Any input would be helpful!
Thanks for the input @renelonngren! I need something specifically for the API and no element related. So I want to send a POST request with the body containing a List of Things in the Bubble database (e.g. Users). If you know of a plugin/method that is able to send a List of Things from Bubble to an external API that would be fantastic!
Oh, do you have an example (or directions) for that? I cannot seem to see any plugin action in the API workflow or in the API connector that will allow me to do that.
Thanks for the steps @renelonngren! Unfortunately, this requires some UI interaction in order to send the list as a string to the API Workflow endpoint (Note that I have already played around with Toolbox plugin to no avail). I would like a way to send a List of Things through the API Connector from the API Workflow.
The endpoint will trigger the API Workflow and the workflow will send a List of Things as a JSON String Body (since there is no way to input as a list right now) to the API Connector API call endpoint
So with what I require, I cannot have a Bubble element be triggered by a user before I can get the List of Things as a string. Thank you for the help though!
One approach could be to build up the list one item at a time, using the text functions, storing as a text database field, and use recursive scheduled API workflow to add each item.
Another approach is to call an external API of your own creation, with separate lists for each field, and have it zipper them together to build up the list of fields.
@renelonngren I like your approach. I used it for my app, but I was faced with a problem I couldn’t solve. When there is a nested data structure, it is difficult to map them all together in one json. I then used the [jsoNest] plugin (jsoNest Plugin | Bubble). With this plugin I was able to create my own json containing data from many tables. It is very flexible. I could specify in great detail which field from which table I wanted in my json. Perhaps this approach is also easier for your case.
Hi there! While trying to make a correctly formated json with nested items to send to an API I also struggled with this issue for a bit, tried plugins but without success. Then I found the simplest, quickest solutions, with no plugins and really easy to grasp and implement.
Basically, I did the following:
I the API call to make, I did not use any paramenters, just pasted in the raw json, and used it to initialize the call:
In my workflow, the data is this call needed to be substituted by data from my workflow, for example “amount”, “currency”; etc. Well, those are inserted as dynamic values and done.
When it came to inserting the dynamic list, in this case product information that the user has purchased, I needed to insert a “mini-json” with this list and the parameters between the [ ] after “Items” in the example above. So I created this mini-json using the “format as text” function, in a previous step and put it in a state (you could do it directly in the main json call as well though).
That looked like this:
note that “item in cart” is a list of items in carts with several attributes.
So, when you click on “format as text”, you get this view where you can specify how to loop through your list: