List Popper and Friends: New SSA Plugin for Your Backend Workflow (API Workflow) Needs

I should also note about this: “Preserve Empty” is not tested for Geographic Addresses and it probably does not work for that data type. In the code, I treat these like Things, but this is quite likely incorrect and it may just fail. If anybody wanted to test that out, I’d appreciate to hear what happens. (Obvs, you’d have to create a list of Geo Addresses that contains empties in a similar way to what I show in the video.)

Thanks @keith. I look forward to reviewing the videos.

@keith when using list pusher, if I pass it a custom state (lets say its defined on a group element) called list_var as the List of Items parameter along with a Item to Push value, does list pusher actually update the original list_var custom state with the new value? Or is the updated list only on the server side and not ever passed back to the client?

I guess in a nutshell I’m trying to find a way to update a custom state at the client level with a list that contains duplicates.

Thanks!

@keith Getting an error when trying to use this plugin for saving a list of twitter followers (from the API - one blob of json with) to the database:

I notice that there are a ton of null values in some API responses - any suggestions?

I have no idea where this property is coming from, as its not part of any API response. Please help :slight_smile:

Response:

Workflow error - Plugin action List Popper SSA error when parsing the response: Cannot read property '_api_c2_id' of null

Call to list popper

{"_class":"ListWrapper","query":{"t":"NodeList","type":"api.apiconnector2.cmiuY0.cmjFW1.data.users","id":"1659040300118x505907434051862500","field":"twitter_followers_list_api_apiconnector2_cmiuY0_cmjFW1_data_users"}}
1 Like

Hey quick question. Can I use any of your list plugins to convert json into a list of things.

Use case is that I want to do an api call using JavaScript on the front end probably in Mishas toolbox plug-in and then convert the returned json into a bubble object.
I know I can create the thing by doing a dummy initialisation in the api connector but as yet have not been able to turn the json into the thing.

I’m getting this as well, specifically with null values coming from an outside API. @keith any plans to fix this?

Update time! Just pushed version 1.2 of List Popper & Friends server-side actions that should make them more compatible with API data types.

It wasn’t really possible before to use these plugins with API response data types as they would incorrectly identify API response objects as Things (and so attempt to convert them into their unique IDs… but API response objects do not have an “_id” field and so this would fail).

So check out version 1.2.0 and let me know if you find any problems!

In my testing, List Popper now works with lists of API response objects. The same sorts of changes have been made to List Popper’s “friends” as well.

(@PasqualeJS @aj11)

5 Likes

:raised_hands:t4: :raised_hands:t4: Huge! You are the goat.

1 Like

Hopefully this works for you now. It should… but LMK if you see issues!

1 Like

Hey Keith can you elaborate on what this means. Does this mean we can pass json and access the fields in the json in a bubble way

No. I just fixed a limitation in the code that confused Things and API ghetto datatypes. (There’s no reason for that to have been an issue, but Bubble doesn’t document anything relating to plugins in any significant way, so plugin devs are left to figure it out for themselves.)

As for your question: I take it that you would like Bubble to support objects. Bubble does not support objects (mostlee). The only objects in Bubble are Things (custom data types). And we cannot create them in the page. They can only be created through interaction with the database.

It’s a serious limitation. But whaddyagonnado?

Here’s an interesting application for List Popper that I just came across - deleting duplicate Things as one might generate when lazily populating a database from CSV:

(Also, I’ve never bothered to populate a database via CSV in the way that the original poster in that thread was attempting, so I figured I’d try it out and learn some stuff. I didn’t learn much as it worked pretty much as I would have expected, but I think this method of deduplication is pretty slick.)

Hi @keith - would it please be possible to have List Shifter’s REVERSE feature applied in List Popper, so that I could reverse a list in a backend workflow?

Without this requested ability, how is it possible to retrieve the nth-from-last item in a list using normal Bubble operators? Bubbly only supplies “item #” from the front of list, and “last item” of the list, but there is no “item # from end”

You don’t say what exactly it is that you want, @greg18. Do you want a separate SSA for reverse? Or do you want to reverse the list on the way into List Popper SSA (and others)?

(I can see how this would be useful at times.)

Note that of course we can use the :sorted operator (or the sort constraint in a Search) to put a list into some defined order (and then, the opposite of that order is to sort descending rather than ascending).

Note also that if you desire to do fancier (and more useful) expressions in the expression builder, you should turn on the “experimental” parenthesis feature. Find it in Settings > Versions under Experimental Features.

With that turned on, you can compose exactly the expression you desire: We already know the last position in the list (it’s :count, yeah?). So the nth-from-last element of some_list is:

some_list :item # (some_list's :count - n)

(The last item in the list is the “0th” item from end. The one before that is count-1 from the end, etc.)

Example - get the third from last element of some list:
image

Runtime:
image

1 Like

Thanks @keith for the suggestion on how to find a single item from the end of the list.

But for my use case I still need to have an entire list reversed in the backend.

So I believe what I want is a separate SSA for Reverse, please!

Again, what’s your next action?. Nothing? If so, a reverse plugin is fine. But. If you’re using an existing List Shifter action, you’d want it integrated with that action.

Correct, no next action.

In my database I have Thing A. Thing A includes Field1, which is a list of Thing Bs.

Thing A also has Field2, which starts empty.

I would like to use a backend workflow to take Thing A’s Field1 list, reverse the list, and save the reversed list into Field2.

Thank you Keith

Hey @greg18 - just-published List Popper & Friends v 1.2.1 adds a “Reverse” option to Flow State List SSA. Use that to get a reversed list back to the workflow.

Reminder: I work for tips! :wink:

2 Likes

WOW that was the world’s easiest software procurement. Thank you so much @keith!! Drinks on me

1 Like

Hey @keith any chance this or one of your plugins could allow adding and remove multiples items from a list in one step?

Say I have a list of 20 items. I want to add 5 at the end and remove the first 5 ones always mantaining the original order as well as duplicates… from what I’ve seen list pusher only allows for single items to be added or removed, correct?

Thank you