---
title: "Set Component/s field from a Cascading field"
canonical: "https://support.appfire.com/space/JMWEC/466323085/Set%20Component%2Fs%20field%20from%20a%20Cascading%20field"
format: markdown
---
> Macro (aura-html)

### Abstract

<span style="color: #333333">This code snippet sets the Component/s field from the value of a Cascading field. This is useful if you have a large number of Components that can be organized in categories, and want to make it easier for users to find the appropriate Component using a Cascading Select input (two dropdown lists).</span>  


### Logic

<span style="color: #333333">Access the Cascading custom field and return its parent and child values separated by a delimiter (that separates the categories in the Component/s)</span>

### Snippet 

```javascript
{% if issue.fields['<Name of the cascading field>'] %}
{{ issue.fields['<Name of the cascading field>'].value }}<Delimiter>{{ issue.fields['<Name of the cascading field>'] | field("child.value") }}
{% endif %}
```

### Placeholders

| Placeholder | Description | Example |
| --- | --- | --- |
| `<Name of the cascading field`> | Name of the field of type Cascading | `Functional Modules` |
| `<Delimiter>` | Delimiter of the parent and the child value | `/` |

### Examples

The output of this snippet is a [String](https://docs.oracle.com/javase/7/docs/api/java/lang/String.html) representing the name of a Component which you could use <span style="color: #333333">for example, to set the Component/s to </span>`Human Resources - Recruitment `<span style="color: #333333">when</span>` Human Resources `<span style="color: #333333">and</span>` Recruitment `<span style="color: #333333">are selected as the parent and child in the Cascading select list, in:</span>

- one of the Set field value post-functions
- the Create issue post-function under Set fields of new issue section
- one of the Transition issue post-functions on the transition screen, if any
  

### References

- [Using Nunjucks Templates](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465503811)
- [Accessing a cascading field](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465505179)

### Related articles

> Macro (contentbylabel)

> Macro (details)
> 
> | Related issues |  |
> | --- | --- |