Hi once again Forma team,
So after experimenting with the hideElement() method of the render Api I noticed that after use it to hide an Element the element re-appears once I exit the extension.
Most importantly the element stays in element hierarchy once I hide it.
Is there a way or possibly will be to delete an element entirely from the Hierarchy??
thanks again for all your help and support
The hideElement method is transient for the purpose of rendering something else instead before anything is saved.
To delete an element it depends on where you delete it from. It seems we currently don't have an API to delete an element directly from the proposal (only replace). If your element is part of an element that belongs to "integrate-elements" you need to create a new hierarchy and then replace the proposal element with it. When you create a new hierarchy you can reference existing trees as children instead of recreating them.
Keep in mind that the elements structure in Forma is immutable, so strictly speaking there is no concept as "edit in-place". All operations lead to new elements being created (so basicly copy the data model, apply patch and save as new element), and the full chain of elements up to the proposal also needs to be changed in the similar way.
The ergonomics around this isn't very good at the moment but we are working on improving this.
Hey @henrik_steenJL382 ,
I think i get a grasp on the approach you suggest.
Would it be too much trouble to ask for code sample of how would achieve "re-creating" the element Hierarchy?
Just how would go about creating a new Hierarchy 'without' an Element?
this would be al lot of help
Thank a lot
Can't find what you're looking for? Ask the community or share your knowledge.