# LeafRef Path not working

**URL:** <https://dmap-community.ductus.global/t/leafref-path-not-working/3607>\
**Category:** YANG\
**Created:** [April 21, 2021, 5:56am UTC](https://dmap-community.ductus.global/t/leafref-path-not-working/3607 "2021-04-21T05:56:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spolisetti](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@spolisetti](https://dmap-community.ductus.global/u/spolisetti)\
**Post date:** [April 21, 2021, 5:56am UTC](https://dmap-community.ductus.global/t/leafref-path-not-working/3607/1 "2021-04-21T05:56:45Z")

</div>

We have a trouble in defining the leafref with predicate

leaf networkSegmentName {

type leafref {  
path “/NS\_TABLE:networkSegmentTable[NS\_TABLE:name in /ADDRESS\_CONTEXT:addressContext/IP\_INTERFACE:ipInterfaceGroup[IP\_INTERFACE:name = current()/…/ipInterfaceGroupName]/IP\_INTERFACE:ipInterface/IP\_INTERFACE:networkSegmentName]/NS\_TABLE:ipNameV6/NS\_TABLE:name”;  
}  
}

leaf ipInterfaceGroupName {  
type string  
tailf:info "  
IP interface group used by this SIP Signaling Port.  
";  
}

NetworkSegmentTable (name is the key for this table) has the list of ipNameV6 names.  
NetworkSegmentTable is attached to ipInterface.

I want to get all the ipNameV6 names to be referenced here, but i want to filter the network segment table whose names matches another path.  
[NS\_TABLE:name in /ADDRESS\_CONTEXT:addressContext/IP\_INTERFACE:ipInterfaceGroup[IP\_INTERFACE:name = current()/…/ipInterfaceGroupName]/IP\_INTERFACE:ipInterface/IP\_INTERFACE:networkSegmentName]

note that there is match of ipInterface group in the filter.

When i am compiling getting error saying invalid path, Can you please help us understand what is going wrong here?

---

<div class="post-metadata">

**Author:** ![mvf](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mvf/32/182_2.png) [@mvf](https://dmap-community.ductus.global/u/mvf)\
**Post date:** [April 21, 2021, 3:54pm UTC](https://dmap-community.ductus.global/t/leafref-path-not-working/3607/2 "2021-04-21T15:54:41Z")

</div>

Predicates in a leafref path, if any, must take the form `[keyname = value]`, as required by the RFC 7950. You need to express complex constraints as must expressions.
