---
title: Write a component with a setting
project: FlowOS
version: 1.0
section: recipes
language: en
license: Total.js Enterprise
url: https://totaljs.es/docs/flowos/1-0/recipes/own-component/
updated: 2026-11-20T18:59:31.073Z
---

# Write a component with a setting

> Create a component that changes one field of a message, with a setting to choose the field.

This recipe builds **Uppercase**, a component that turns one text field of the incoming object into capital letters. A setting lets you choose the field.

## Create the component

**1.** Select **Add** (plus), then **Create new component**.

**2.** Replace the whole template with this code:

```html
<script total>

	exports.id = 'uppercase';
	exports.name = 'Uppercase';
	exports.icon = 'ti ti-font';
	exports.author = 'Demo project';
	exports.version = '1';
	exports.group = 'Demo';
	exports.config = { field: 'name' };
	exports.inputs = [{ id: 'input', name: 'Input' }];
	exports.outputs = [{ id: 'output', name: 'Output' }];

	exports.make = function(instance, config) {
		instance.message = function($) {
			var data = $.data;
			if (data && typeof(data[config.field]) === 'string')
				data[config.field] = data[config.field].toUpperCase();
			$.send('output', data);
		};
	};

</script>

<readme>
Changes one text field of the incoming object to capital letters.
</readme>

<settings>
	<div class="padding">
		<ui-component name="input" path="?.field" config="required:1">Field name</ui-component>
	</div>
</settings>

<body>
	<header>
		<i class="ICON"></i>NAME
	</header>
</body>
```

**3.** Select **APPLY**. **Uppercase** appears in the **Demo** group on the left.

## Use it

1. Set the **Trigger** to send an object, as in [Your first flow](../../guides/first-flow/).
2. Drag **Uppercase** onto the canvas.
3. Connect **Trigger** to **Uppercase**, and **Uppercase** to **Print**.
4. Select **APPLY** and confirm.
5. Select **Run** on the **Trigger**.

**Print** shows the object with the name in capital letters. Double-click the **Uppercase** node to choose another field.

![A Trigger connected to Uppercase and Print, which shows JANE DOE](/files/JasqM420H61f.webp)

## Share it

Save the code as `uppercase.html`. You can drop the file on another FlowOS, or put it on a web server and install it with **Link component**. See [Add components](../../guides/add-components/).

To learn more about the component format, see the [Flow development guide](/flow/11-1/development/introduction/).
