> For the complete documentation index, see [llms.txt](https://support.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.docstudio.com/user/scenarios/condition-types/one-to-many-condition.md).

# ​One-to-Many Condition

Use this condition type only for tables inside a document. It must return `true` or `false` for each table row in this format:

{% code title="result.xml" lineNumbers="true" %}

```xml
<result>
  <rows>
    <row index='0'>true<row>
    <row index='1'>false<row>
    <row index='2'>false<row>
    <row index='3'>true<row>
  </rows>
</result>
```

{% endcode %}

The `index` attribute must match the `index` attribute in the `fieldset` node.

Example condition XSLT:

{% code title="one-to-many-condition.xslt" lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <result>
            <rows>
                <xsl:for-each select="envelope/documents/document[@id='document_id']/fieldgroup[@name='table_name']/fieldset">
                    <row index="{@index}">
                        <xsl:choose>
                            <xsl:when test="field[@name='field_name']='Yes'">
                              true
                            </xsl:when>
                            <xsl:otherwise>
                                false
                            </xsl:otherwise>
                        </xsl:choose>
                    </row>
                </xsl:for-each>
            </rows>
        </result>
    </xsl:template>
</xsl:stylesheet>
```

{% endcode %}

For each row where the result is `true`, the system creates a new envelope. To pass the row index into the XSLT mapping, add this parameter:

{% code title="parameters.xslt" lineNumbers="true" %}

```xml
<xsl:param name="row_index"/>
```

{% endcode %}

Use it like this:

{% code title="field-value.xslt" lineNumbers="true" %}

```xml
<field name="field_name">
    <xsl:value-of select="envelope/documents/document[@id='document_id']/fieldgroup[@name='table_name']/
        fieldset[@index=$row_index]/field[@name='field_name']/@value"/>
</field>
```

{% endcode %}
