---
title: "Concatenate text fields without null - Groovy"
canonical: "https://support.appfire.com/space/JMWE/461701527/Concatenate%20text%20fields%20without%20null%20-%20Groovy"
format: markdown
---
> Macro (aura-html)

### Abstract

This code snippet concatenates two text fields ignoring null values

### Logic

Access the text fields and concatenate them

### Snippet

```javascript
textutils.noNull(<First text field>) + "<Delimiter>" + textutils.noNull(<Second text field>)
```

### Placeholders

| **Placeholder** | **Description** | **Example** |
| --- | --- | --- |
| `<First text field>` | Accessing the first text field | `issue.get("description")` |
| `"<Delimiter>"` | Delimiter separating the text fields | `"\n"` |
| `<Second text field>` | Accessing the second text field | `issue.get("summary")` |

### Examples

The output of this code is a [String](https://docs.oracle.com/javase/7/docs/api/java/lang/String.html) which you could, for example use in:

**A Groovy expression, for example to:**

- Set a text field to the concatenation of two other text fields. Eg: The summary of the issue to the concatenation of two custom field values, say Customer Name and Machine details in:
  - one of the Set Field Value post-functions
  - the Create issue post-function under Set fields of new issue section

**A Groovy template, for example to:**

- Include the key and description while notifying the customer when their issue has been resolved:
  - Comment in one of the Comment issue post-functions
  - Subject/HTML body/Text body of Email issue post-function

### 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)
- [**Groovy Documentation**](http://groovy.codehaus.org/User+Guide)

### Related articles

> Macro (contentbylabel)

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