Forum Academy Marketplace Showcase Pricing Features

Can't delete a cell from an API-populated RG

Hey there,

I’m trying to implement a functionality that allows a user to delete a row from a repeating group upon clicking a button that’s self-contained within each RG’s row.
My RG is being populated with information from an API call and it’s of the type defined in the API response for that list of fields I’m interested in (Parse resume Affinda extracted_data_work_experience entry).

I have made sure that the group containing the button that will trigger this delete action is configured with a data source of (Parent group’s Parse resume …) .

For some reason, when I try to configure a “Delete a thing” action on that button, I can’t reference “Parent Group’s cell/thing” and hence I don’t have a way to delete that particular cell/row. I sense it might be somehow related with the fact that the RG is of a special type and populated from an API call, but I might be wrong.

Any ideas on what am I not doing correctly?

Many thanks!



You cannot use delete thing if the data source is not Bubble database thing! You need to take an action using API connector to delete it on API if this is really what you want.

1 Like

Thanks Jici, that makes sense. Do you know how would that action look like in API connector? I’m a bit lost there …

Are you actually trying to delete it?

Or just remove it from the RG?

Well there’s annother answer @Jici:, if you have a list of anything, you can remove a single anything from the list and update whatever state holds the list of things.

Now in API datatypes that are lists, we don’t have a single “anything” there’s only a concept of a list of anythings. So you can make a 1-item list of the API anything in question and :minus list that from the full list, if I’m not mistaken.

Presumably the full list is stored on some field of some Thing or in some state that we can modify and if we wanted to record the change we’d take whatever field that is and set it’s value to the new list of API responses.

(The entire operation described above may not be able to be accomplished in a “one liner” but could be done in two workflow steps.)

The answer is based on what youwant todo exactly. Delte it on API or removebit from visible thing in list. This is what @adamhholmes ask. And my response was more about using delete a thing action that can only be applied to a Bubble thing, not API thing

Not necessarily deleting it because I don’t actually save anything on the DB until I click “Save”. I just need to remove it from the RG because the button “Save” will push all rows from the RG into the DB.
I could make it work somehow so that it stores the right entries on the DB by saving current cell’s index on a separate VAR for every row in which I click “Remove Experience”, and then simply just making the recurring backend workflow (that saves the data into the DB) not to run on those index values, however it wouldn’t look good UX wise because nothing would happen “visually” when a user clicks on Remove Experience (the entry would remain in the RG).

I just need to remove it from the RG

Just use a Display List workflow action.

the list to display being the RG’s list of things: minus item: current cell’s thing

3 Likes

This may not work with API response objects that come to us as a list, which is what I assumed @pavilaflores was experiencing. (They have - or at least used to have - a strange property that the entire “List of Response” is a type, but the individual items in the list are not of that type. Hence turn an individual item into a one-item list of the type and subtract that list from the full list.)

Not sure if :converted to list operator will be available in this context, but if so with parens turned on you can do:

RG’s List of Blah :minus list ((RG’s List of Blah :item # current cell’s index) :converted to list)

(This would usually be silly/pointless, obviously.)

2 Likes

Just use a Display List workflow action.
the list to display being the RG’s list of things: minus item: current cell’s thing

It does not allow me to do that … It only allows me to select an individual item from within that RG’s cell, and not the entire cell/entry on its own

Hence turn an individual item into a one-item list of the type and subtract that list from the full list.)
Not sure if :converted to list operator will be available in this context, but if so with parens turned on you can do:
RG’s List of Blah :minus list ((RG’s List of Blah :item # current cell’s index) :converted to list)
(This would usually be silly/pointless, obviously.)

Can you point me specifically where would I have to do that @Keith ? Trying to build that expression within a Display data workflow upon clicking the “Remove experience” button but it’s not allowing me to do so


First turn parens on. You don’t have to refer to the RG relatively, do you? (I’d be surprised if both @adamhholmes and I both got this wrong, but I am AFK at the moment.)

Just refer to it directly. “Repeating Group Parse”‘s blah blah blah

2 Likes

omg that was the problem, I was obfuscated only trying the “Parent group thing…” instead of just referring to it directly.

Once I referred it that way I didn’t even have to use parenthesis, I could do as @adamhholmes suggested and simply subtract Parent Group cell from the wider RG …

Thanks a lot to both of you @keith @adamhholmes , saved my day!

2 Likes

Good to hear! (Especially that a simple :minus item worked.)

1 Like