# How to selectively reset a leaf in a container

**URL:** <https://dmap-community.ductus.global/t/how-to-selectively-reset-a-leaf-in-a-container/4558>\
**Category:** YANG\
**Created:** [October 24, 2023, 6:40pm UTC](https://dmap-community.ductus.global/t/how-to-selectively-reset-a-leaf-in-a-container/4558 "2023-10-24T18:40:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swaroop](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@Swaroop](https://dmap-community.ductus.global/u/Swaroop)\
**Post date:** [October 24, 2023, 6:40pm UTC](https://dmap-community.ductus.global/t/how-to-selectively-reset-a-leaf-in-a-container/4558/1 "2023-10-24T18:40:33Z")

</div>

Hi

I have a container with 3 leaves, namely a,b and c. What I need is

1. If a is set, we need to reset b and c.
2. If b or c is set, need to reset a.

First one is possible by using tailf reset-container. Is it possible to do the second one? Pls help with any solutions for this. Snippet of model given below

```
   container fixup {
      leaf a {
        tailf:cli-reset-container;
        tailf:cli-full-command;
        type empty;
      }
      leaf b {
        tailf:cli-full-command;
        type empty;
      }
      leaf c {          
        tailf:cli-full-command;
        type empty;
      }
    }

```

Thanks  
Swaroop

---

<div class="post-metadata">

**Author:** ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)\
**Post date:** [October 25, 2023, 11:30am UTC](https://dmap-community.ductus.global/t/how-to-selectively-reset-a-leaf-in-a-container/4558/2 "2023-10-25T11:30:49Z")

</div>

Welcome!

Maybe you can use YANG’s `choice` statement? Something like:

```plaintext
container fixup {
  choice fixup-choice {
    case only-a {
      leaf a { type empty; }
    }
    case some-of-b-c {
      leaf b { type empty; }
      leaf c { type empty; }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Swaroop](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@Swaroop](https://dmap-community.ductus.global/u/Swaroop)\
**Post date:** [October 25, 2023, 6:47pm UTC](https://dmap-community.ductus.global/t/how-to-selectively-reset-a-leaf-in-a-container/4558/3 "2023-10-25T18:47:50Z")

</div>

Thank you.  
That worked
