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

### Abstract

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).

### Logic

Access the Cascading custom field and return its parent and child values separated by a delimiter (that separates the categories in the Component/s)

### Snippet

```javascript
if(issue.get("<Name of the Cascading field>"))
{
  issue.get("<Name of the Cascading field>").get(null).getValue() + "<Delimiter>" + issue.get("<Name of the Cascading field>").get("1")
}
```

### 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 a Component name which you could use in a Groovy expression, for example, to set the Component/s to `Human Resources - Recruitment `when` Human Resources `and` Recruitment `are selected as the parent and child in the Cascading select list, in:

- one of the Set field value post-functions
- the Create issue post-function under Set fields of new issue section

### References

- [Variables used in a Groovy expression](https://appfire.atlassian.net/wiki/display/JMWE/Variables+used+in+a+groovy+expression)
- [Issue interface](https://appfire.atlassian.net/wiki/display/JMWE/Issue+Interface)
- [User-created custom fields](https://appfire.atlassian.net/wiki/display/JMWE/User+created+custom+fields)
- [**Groovy Documentation**](http://groovy.codehaus.org/User+Guide)

### Related articles

> Macro (contentbylabel)

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