How to remove at index for an object within an array of objects that is within an object

I have an object and within the object have an array of objects, “program_details”:

image

How do I REMOVE a particular index from this array?

For example, I want to remove index “1” from this program_details array of 3 objects.

I am able to change a particular index by doing this:

But what about removing the whole thing?

I am able to use custom JS to do this but am wondering if there is a no code way to do this as thats easier to maintain.

I think at the moment there is no nocode way to do it, as we display the interface depending on your varaible type, and here your variable is an Object so you do not have the “remove” from array.
We did not think about the nesting solution.
I do not know what will be the best way to help you on this if we developped the feature. What will you expect here in term of interface?

While it’s not nocode, it’s a fairly simple formula


//Given this object

const a = {a:””,b:[{g:””},{g:””}]} //your weweb object variable value

//How can you remove an object at a given index from property b? 


//To remove an object from the array `b` at a given index, you can use the `splice` method. Here's how you can do it:
 
const indexToRemove = 1;  // For example, to remove the second object
const newObjectValue = a.b.splice(indexToRemove, 1);

Replace indexToRemove with the desired index of the object you want to remove from the array b. After running this code, the object at the specified index will be removed from the b array in the a object.

Now you can return newObjectValue and use it to replace the entire original object

I could really do with a way to remove from nested object variables.

I would expect it to work similar to “Partial update” and “reset variable”. The problem with reset variable is I can’t target the path / nested items in an object so doesn’t offer the needed control.

It doesn’t seem too taxing. Perhaps a new operator would be easy to bring in quicker? deleteAtKey?

image

Is omit what you are looking for?

No, sorry. It says it’s for “returning an object”.

I’d like to update the nested object.