> 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/building-references.md).

# Building references

There are three ways to create reference values in your XML files.

## Using a known Object ID

If you know the Object ID of an object in the FIM service, you can reference the Object ID directly. The following example shows adding the built-in administrator to the membership of a set

```xml
<AttributeOperation operation="add" name="ExplicitMember">7fb2b853-24f0-4498-9534-4e10589723c4</AttributeOperation>
```

## Referencing another ResourceOperation element

If you have a resource defined in your XML file as a [ResourceOperation element](/resource-management-powershell/v1.0/configuration/operations-element/resourceoperation-element.md), you can reference the ResourceObject instead, and the tool will automatically populate the reference attribute with the correct Object ID using an [AttributeOperation](/resource-management-powershell/v1.0/configuration/operations-element/attributeoperations-element/attributeoperation-element.md) with a type of `xmlref`

```xml
<!-- Create the workflow to reference -->
<ResourceOperation operation="Add Update" resourceType="WorkflowDefinition" id="demoWorkflowDefinition">
      <AnchorAttributes>
        <AnchorAttribute>DisplayName</AnchorAttribute>
      </AnchorAttributes>
      <AttributeOperations>
        <AttributeOperation operation="replace" name="DisplayName">___Demo Workflow Definition</AttributeOperation>
        <AttributeOperation operation="replace" name="XOML" type="file">.\Templates\WFDemo.xml</AttributeOperation>
        <AttributeOperation operation="replace" name="RequestPhase">Action</AttributeOperation>
        <AttributeOperation operation="replace" name="RunOnPolicyUpdate">false</AttributeOperation>
      </AttributeOperations>
</ResourceOperation>

<!-- Update the MPR that references the workflow -->
<ResourceOperation operation="Update" resourceType="ManagementPolicyRule" id="demoMPR">
      <AnchorAttributes>
        <AnchorAttribute>DisplayName</AnchorAttribute>
      </AnchorAttributes>
      <AttributeOperations>
        <AttributeOperation operation="none" name="DisplayName">___Demo MPR - Triggers Workflow</AttributeOperation>
        <AttributeOperation operation="replace" name="ActionWorkflowDefinition" type="xmlref">demoWorkflowDefinition</AttributeOperation>
       </AttributeOperations>
</ResourceOperation>
```

## Referencing an object that exists in the FIM Service

If you know that an object exists in the FIM service (such as an object-of-box object), you can reference it directly using the `reference` type on the [AttributeOperation element](/resource-management-powershell/v1.0/configuration/operations-element/attributeoperations-element/attributeoperation-element.md). The following example sets the ExplicitMember attribute of one object to a reference to the "Administrators" built-in set.

```xml
<AttributeOperation operation="add" name="ExplicitMember" type="reference">Set|DisplayName|Administrators</AttributeOperation>
```

## Deferencing an XML ResourceOperation

You can dereference a ResourceOperation and get one of the attributes contained in the object using a special variable syntax using the format `##xmlref:<xmlrefid>:<attribute name>##`. In the following example we define a Workflow definition with its known display name

```xml
<ResourceOperation operation="None" resourceType="WorkflowDefinition" id="demoWorkflowDefinition">
      <AnchorAttributes>
        <AnchorAttribute>DisplayName</AnchorAttribute>
      </AnchorAttributes>
      <AttributeOperations>
        <AttributeOperation operation="none" name="DisplayName">___Demo Workflow Definition</AttributeOperation>
      </AttributeOperations>
</ResourceOperations>
```

Which can then be referenced by attribute operations within other ResourceOperations

```xml
<AttributeOperation operation="replace" name="Description">Triggers the "##xmlref:demoWorkflowDefinition:DisplayName##" workflow</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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lithnet.io/resource-management-powershell/v1.0/configuration/building-references.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
