> For the complete documentation index, see [llms.txt](https://docs.lithnet.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lithnet.io/resource-management-powershell/v1.0/configuration/operations-element/attributeoperations-element/attributeoperation-element.md).

# \<AttributeOperation> element

The `<AttributeOperation>` defines what action should be taken on an attribute.

| XML Attribute Name | Description                                                                                             | Allowed Values                                                                                                                                                                                                      |
| ------------------ | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| operation          | Required. The type of operation to perform on the attribute                                             | See the operation types section on this page                                                                                                                                                                        |
| name               | Required. The system name of the attribute as it appears in the FIM Service Schema                      | Any valid FIM service system attribute name that is bound to the resource type specified in the parent [ResourceOperation](https://github.com/lithnet/resourcemanagement-powershell/wiki/ResourceOperation-element) |
| type               | Optional. Defines the type of value provided in the element \| See the value types section on this page |                                                                                                                                                                                                                     |

### Operation Types

The following operation types are supported for attribute values

| Operation type                                                                                                          | Description                                                                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| none                                                                                                                    | The 'none' operation is used when defining an \[\[anchor attribute                                                                                                            |
| add                                                                                                                     | Add the value                                                                                                                                                                 |
| replace                                                                                                                 | Replaces the value of the attribute with that specified in the element text                                                                                                   |
| delete                                                                                                                  | Deletes the specified value                                                                                                                                                   |
| ### Value Types                                                                                                         |                                                                                                                                                                               |
| Value type                                                                                                              | Description                                                                                                                                                                   |
| ---                                                                                                                     | ---                                                                                                                                                                           |
|                                                                                                                         | If a value type is not specified, then the text contents of the element are used as the attribute value. The text will be searched for any \[\[variable                       |
| file                                                                                                                    | Specifies that the text content of the element refers to a file which should be imported and used as the attribute value. The file will be searched for any \[\[variable      |
| xmlref                                                                                                                  | Specifies that the text content of the element refers to another object that has an existing \[\[ResourceOperation                                                            |
| filter                                                                                                                  | Specifies that the text content of the element is an XPath filter, and should be wrapped with the XML XPath descriptor. The filter text will be searched for any \[\[variable |
| ref                                                                                                                     | Specifies that the text content of the element is a reference to another object within the FIM service. Objects are referenced using the format \`\`\`ObjectType              |
| ### Example                                                                                                             |                                                                                                                                                                               |
| The following example shows an attribute operation that sets the text of the attribute to that specified in the element |                                                                                                                                                                               |
| \`\`\`xml                                                                                                               |                                                                                                                                                                               |
| \_Demo Set                                                                                                              |                                                                                                                                                                               |
| \`\`\`                                                                                                                  |                                                                                                                                                                               |

The following example shows an attribute operation that constructs a filter attribute. Only the XPath is provided, and the XML wrapper gets added automatically

```xml
<AttributeOperation operation="replace" name="Filter" type="filter">/Person</AttributeOperation>
```

The following example shows an attribute operation that imports the text content of `myworkflow.xml` and saves that content to the `XOML` attribute

```xml
<AttributeOperation operation="replace" name="XOML" type="file">.\myworkflow.xoml"</AttributeOperation>
```

The following example shows an attribute operation that sets the value of the attribute to the display name of another object

```xml
<AttributeOperation operation="replace" name="ExplicitMember" type="ref">Set|DisplayName|_DemoSet</AttributeOperation>
```

Alternatively if the resource in question is already in the XML file, and has a \[\[ResourceOperation element]] with an id of `setDemo`

```xml
<AttributeOperation operation="replace" name="ExplicitMember" type="xmlref">setDemo</AttributeOperation>
```

Given a \[]\[Variable element] with a name of `#environment#`, the following example shows how to use that variable in a text value The following example shows an attribute operation that sets the text of the attribute to that specified in the element

```xml
<AttributeOperation operation="replace" name="DisplayName">_Demo Set in #environment#</AttributeOperation>
```


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.lithnet.io/resource-management-powershell/v1.0/configuration/operations-element/attributeoperations-element/attributeoperation-element.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
