> For the complete documentation index, see [llms.txt](https://1spatial.gitbook.io/fme-form-beginner/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://1spatial.gitbook.io/fme-form-beginner/transformer-usage/managing-attributes/creating-and-setting-attributes.md).

# Creating and Setting Attributes

Creating attributes and setting a value are probably the primary attribute functions used within FME. When an attribute is created, its value can be set in a number of ways.

The transformers capable of creating an attribute, and setting its value, are:

* AttributeCreator
* AttributeManager

***Note**: The AttributeCopier and AttributeRenamer transformers can set an attribute value, but only where the attribute doesn't already exist.*

## AttributeManager

For most operations we'll concentrate on the AttributeManager, so here is a quick overview of that transformer.

The AttributeManager parameters dialog has a number of fields: Input Attribute, Output Attribute, Attribute Value, Type and Action. Uniquely among attribute-handling transformers, it is automatically filled in with the details of the attributes connected to it:

The action field can be set by the user but is also set automatically when a change is made to the other fields.

<figure><img src="/files/003vU79RB0aDz9kZC11X" alt=""><figcaption></figcaption></figure>

## Manually Create an Attribute

By entering a new attribute name into the Output Attribute field, it will be created in the output.

<figure><img src="/files/olDXx3ZMj20YWtZ8UOdq" alt=""><figcaption></figcaption></figure>

The text \<Add new Attribute> highlights where a new attribute can be created. By default, when the Attribute Value field is empty, a new attribute has no value.

## Set a Fixed Attribute Value

A fixed (or constant) value for an attribute can be created by simply entering a value into the Attribute Value field:\
Here, for example, a new attribute called City is being given a fixed value of Vancouver.

<figure><img src="/files/H8NCMfr6ZBegxEPkfzvt" alt=""><figcaption></figcaption></figure>

However, also note that the existing attribute NeighborhoodName is also being assigned a fixed value. It has been given the value "Kitsilano." Notice how by entering a value into that field, the Action field has automatically changed from "*Do Nothing*" to "Set Value."

Besides entering set values like this, it's possible to construct an attribute value in a number of different ways...

## Constructing Attributes

Besides constant attribute values, FME also allows you to construct values using string manipulation and arithmetic calculations. This procedure is achieved by clicking on the arrow in the Attribute Value field and selecting either Open Text Editor or Open Arithmetic Editor:

<figure><img src="/files/noJa3gJIzafWMTT1JpA2" alt=""><figcaption></figcaption></figure>

This method is advantageous because the attribute no longer needs to be a fixed value: it can be constructed from a mix of existing attributes, parameters, and constants.

### Text Editor

The text editor - as you would expect - allows you to construct a text value. It includes all the usual string-handling functionality you would need, such as concatenation, trimming, padding, and case-changing.

The text editor looks like this:

<figure><img src="/files/Y1oHVom9ia43IZqNFoti" alt=""><figcaption></figcaption></figure>

Here the user is constructing an address string by concatenating various existing attributes with some fixed characters (the commas).

Notice the menu on the left-hand side. Existing attributes are listed here and were added into the string by double-clicking them. Also, notice the other menu options. Maybe the most important for text are String Functions:

<figure><img src="/files/J4LT9JCWkux51NXThl91" alt=""><figcaption></figcaption></figure>

These are the functions that can be used to manipulate the strings being used. For example, here the user is making sure the attributes being used are trimmed when used:

<figure><img src="/files/pDfyyfeyiQ3U0FRQAfe5" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**TIP**

*Notice the Date/Time functions in the text editor, which can be used to manipulate dates, times, and datetime strings; including TimeZone components.*
{% endhint %}

### Arithmetic Editor

The arithmetic editor is much the same as the text editor, except that whatever is entered into the dialog will be evaluated as an arithmetic expression, and a numeric result returned:

<figure><img src="/files/XOY2Uuw4LBrEbcd2d7FU" alt=""><figcaption></figcaption></figure>

Here the user is calculating the monthly number of visitors to a park by dividing the annual number of visitors by 12 (twelve). As with the text editor, existing attributes and arithmetic functions were obtained from the menu on the left-hand side.

## Constructing Parameters

Let's just put attributes to one side for a moment and look at transformer parameters.

Transformer parameters are often set in a fixed way (hard-coded) or set to take on the value of a particular attribute. However, in the same way that attributes can be constructed, text or arithmetic editors can be used to build values for transformer parameters.

### Using Attributes for Parameters

As noted, most transformer parameters allow the user to select an attribute value instead of manually entering a fixed value. For example, the LabelPointReplacer can create a label whose contents and height are specified by attribute values:

<figure><img src="/files/oFSfYRKmoXOaVufubT9Q" alt=""><figcaption></figcaption></figure>

This feature is useful because it allows the parameters (for example label size) to get a different value for each feature. An attribute could be read from a source dataset, or calculated using an ExpressionEvaluator so that one feature creates a label ten units in height, another creates a label 15 units high, and so on. It is no longer a fixed value.

### Constructing Parameter Values

If a parameter value needs to be calculated or constructed, instead of using a separate transformer, FME has integrated string and numeric editors built into parameter dialogs.

For example, here the user is choosing to calculate label height using an arithmetic calculator:

<figure><img src="/files/EHGOYyP8Si9bvkL2kDAW" alt=""><figcaption></figcaption></figure>

The calculator allows the selection and use of FME attributes, other parameters, plus mathematical and string-based functions. For example, here the user has chosen to calculate the height of their labels using the logarithm of the visitor count for a park:

<figure><img src="/files/cdEf0Q3fSVXVtB529TnG" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**NOTE**

*It's a fixed rule that the editor dialogs available depend upon the type of parameter being set. For instance, the Label parameter in a LabelPointReplacer opens a text editor because the parameter requires a text value. The Label Height parameter opens an arithmetic editor because that parameter requires a numeric value.*
{% endhint %}

### Reducing Workspace Congestion

Like when attribute values are constructed, workspaces are more compact when as many peripheral operations as possible are directly integrated into a single transformer or parameter. However, as with attributes, it's important to add proper annotation, else it's difficult for a casual observer to understand what the workspace is meant to do.

Another drawback, specific to parameters, is that you don't also get the information as an attribute to use elsewhere. For example, if you construct a label string in the LabelPointReplacer, that string isn't available as an attribute elsewhere in the workspace.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://1spatial.gitbook.io/fme-form-beginner/transformer-usage/managing-attributes/creating-and-setting-attributes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
