# Edge doesn't point to field in record if defined as part of a group

**URL:** <https://forum.graphviz.org/t/edge-doesnt-point-to-field-in-record-if-defined-as-part-of-a-group/884>\
**Category:** Help\
**Created:** [October 20, 2021, 3:30am UTC](https://forum.graphviz.org/t/edge-doesnt-point-to-field-in-record-if-defined-as-part-of-a-group/884 "2021-10-20T03:30:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maccaroo](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/maccaroo/32/506_2.png) [@maccaroo](https://forum.graphviz.org/u/maccaroo)\
**Post date:** [October 20, 2021, 3:30am UTC](https://forum.graphviz.org/t/edge-doesnt-point-to-field-in-record-if-defined-as-part-of-a-group/884/1 "2021-10-20T03:30:22Z")

</div>

I’m using Graphviz (and the dot language) to document the operations for a web app . Since there are often many operations available on a page, I’ve been grouping the mappings for neatness and to prevent repeating myself.

However, I’m unable to get edges to point to the correct field in a record, when the edges are defined in a group. Individually they work fine.

Before anyone asks, I realise record-based nodes are largely superseded by HTML-like labels. However, those are too verbose for what I’m trying to achieve and I don’t need the extra features, so I’m sticking with the original.

Here’s a working example:

![image](https://global.discourse-cdn.com/graphviz/original/1X/29f9236e9691df259a4de03ce7ab0a5102a0391d.png)

```auto
digraph site_map {

    // Pages
    {
        node[shape=component]
        
        page1[label="Page 1"]
        page2[label="Page 2"]
    }
    
    // Operations
    {
        node[shape=record style=filled fillcolor=green]
        
        entity1[label="Entity 1 | {<save> Save |<get> Get |<del> Del}"]
        entity2[label="Entity 2 | {<save> Save |<get> Get |<del> Del}"]
    }

    // Mappings: Page -> Operation
    {
        // Page 1 - short form (doesn't work)
        page1 -> {
            entity1:save
            entity1:get
            entity1:del
            
            entity2:get
        }
        
        // Page 2 - Long form
        page2 -> entity1:save
        page2 -> entity1:get
        page2 -> entity1:del
        page2 -> entity2:get
    }
}

```

I originally posted this question on Stackoverflow [here](https://stackoverflow.com/questions/69625104/graphviz-edge-doesnt-point-to-field-in-record-if-defined-as-part-of-a-group)

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [October 22, 2021, 1:13am UTC](https://forum.graphviz.org/t/edge-doesnt-point-to-field-in-record-if-defined-as-part-of-a-group/884/2 "2021-10-22T01:13:24Z")

</div>

Here is the best (non) answer I can find from **Drawing graphs with dot** ([https://www.graphviz.org/pdf/dotguide.pdf](https://www.graphviz.org/pdf/dotguide.pdf)):

> a subgraph defines a subset of nodes and edges

There are only two nodes in your subgraph: _entity1_ and _entity2_, the three hoped-for edges are collapsed into one.  
What you want makes perfect sense and the syntax is legal, but no go.

By the way, you would not get a “better” result if you used html-like records.
