# How to flush all the elements in the list, if there is change in node

**URL:** <https://dmap-community.ductus.global/t/how-to-flush-all-the-elements-in-the-list-if-there-is-change-in-node/3107>\
**Category:** YANG\
**Created:** [June 15, 2020, 9:05am UTC](https://dmap-community.ductus.global/t/how-to-flush-all-the-elements-in-the-list-if-there-is-change-in-node/3107 "2020-06-15T09:05:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@vikas](https://dmap-community.ductus.global/u/vikas)\
**Post date:** [June 15, 2020, 9:05am UTC](https://dmap-community.ductus.global/t/how-to-flush-all-the-elements-in-the-list-if-there-is-change-in-node/3107/1 "2020-06-15T09:05:01Z")

</div>

list abc{

```
  leaf bcd{
           type string ;

```

}  
}  
if there are any changes in the leaf, all the elements in the list has to be deleted.

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [June 15, 2020, 9:41am UTC](https://dmap-community.ductus.global/t/how-to-flush-all-the-elements-in-the-list-if-there-is-change-in-node/3107/2 "2020-06-15T09:41:38Z")

</div>

That would be Bad Thing (trademark Per) to do if that’s config and you ever want to support machine-to-machine interfaces like NETCONF and RESTCONF. Spontaneous reconfiguration by the device make the client/manager get out of sync with the device.  
But if you intend to serve human dinosaurs with a CLI/WebUI only, you can for example use a transaction-hook to remove what you want when a certain leaf is changed.  
See ConfD UG Chapter “Hooks” and examples.confd/intro/11-c\_hooks for details
