# Creating a string using parts of other strings

Create a new string by modifying other strings using the LowerCase, Concat and Substring functions.

## Before you begin

You have created a map with an input and an output structure. You can use the samples provided below.

## About this task

In this example, you have a JSON file with users' first and last names. You want to generate a user ID, all in lowercase, composed of the full last name and the first two letters of the first name. You can use the following JSON sample as input:

```
{
	"users": [
		{
			"lastName": "Doe",
			"firstName": "John"
		},
		{
			"lastName": "Smith",
			"firstName": "Jane"
		},
		{
			"lastName": "Scott",
			"firstName": "Michael"
		}
	]
}
```

You can use the following JSON sample to create your output structure:

```
{
	"users": [
		{
			"lastName": "",
			"firstName": "",
			"id": ""
		}
	]
}
```

## Procedure

1. Place the input users element on the corresponding output element to map lastName and firstName.

   ![Input element for output map.](https://help.qlik.com/talend/en-US/data-mapper-functions-reference-guide/Resources/images/tdm-substring-example-01.png)
2. Place a LowerCase function on the output id element.
3. Add a Concat function on the InputValue attribute of the LowerCase function.
4. Place the input lastName element on the Concat function.
5. Add a Substring function on the Concat function, under lastName.
6. Place the input firstName element on the Input Value attribute of the Substring function.
7. Double-click the Substring function to configure its properties:
   1. Enter 1 in the Start field to indicate that the substring should start with the first character of the firstName element.
   2. Enter 2 in the Length field to indicate that the substring should have a length of two characters.

   ![Expression Substring Properties window.](https://help.qlik.com/talend/en-US/data-mapper-functions-reference-guide/Resources/images/tdm-substring-example-02.png)
8. Click OK.

## Results

Your map is configured and looks like this: ![Map result.](https://help.qlik.com/talend/en-US/data-mapper-functions-reference-guide/Resources/images/tdm-substring-example-03.png)

You can use the Test Run feature to see the result. In this example, the following output is returned:

```
{
    "users": [
        {
            "lastName": "Doe",
            "firstName": "John",
            "id": "doejo"
        },
        {
            "lastName": "Smith",
            "firstName": "Jane",
            "id": "smithja"
        },
        {
            "lastName": "Scott",
            "firstName": "Michael",
            "id": "scottmi"
        }
    ]
}
```