> For the complete documentation index, see [llms.txt](https://docs.cloudfabrix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudfabrix.io/rda/rda-userguide/rda-data-management-cfxdm/cfxdm-dm-map.md).

# cfxdm - dm:map

**dm:map:** This cfxdm tag allows the user to manipulate or transform the  columns and it's values.&#x20;

Below are some of the operations you can perform using this tag.

* Copy the Column X along with it's values as is and create a new Column Y
* Transform values from a Column to something else using 'functions' based on user's requirement

**dm:map syntax:**&#x20;

* **dm:map from = '*****COLUMN\_X*****' & to = '*****COLUMN\_Y*****'**

OR

* **dm:map attr = '*****COLUMN\_Y' &*****&#x20;func&#x20;*****= "\<function-name>"  & \<argument syntax>***

{% hint style="info" %}
**Note:** Only single '**func**' is supported per **dm:map** tag usage.
{% endhint %}

In the below example, for a reference, we are going to use **VMware vROps** as an extension to query the data and ingest it into **dm:map** tag for data manipulation or transformation using cfxdm functions.

Enter the below command to select **VMware vROps VM Summary tag (**\*vrops:**vm\_summary**). (In this example, vrops name is used as a label to identify VMware vROps extension and it's tags. The label is defined while adding the extension in cfxdx configuration file or through UI.)

```
tag *vrops:vm_summary
```

![](/files/-MVKX59QfqdHMCv6j6rB)

**Example 1:** Clone the Column (copy)

Get the data from VMware vROps VM Summary tag (**\*vrops:vm\_summary**) which includes some of the below columns, **clone** the column '**guest\_full\_name**' to '**guest\_os\_type**'.

**Column Names:**

* guest\_hostname
* guest\_ip\_address
* **guest\_full\_name**
* datastore
* .....

```
data --> @dm:map from = 'guest_full_name' & to = 'guest_os_type'
```

![](/files/-MVK_xb6A0El1RH994r-)

**Example 2:** Clone the Column (copy) & Transform the data with function 'evaluate' (simple 'if' and 'else' condition using a python expression)

Get the data from VMware vROps VM Summary tag (**\*vrops:vm\_summary**) which includes some of the below columns, **clone** the column '**guest\_full\_name**' to '**guest\_os\_type**' and transform the values (data) within the '**guest\_os\_type**' based on the existing value.

If column **guest\_os\_type's** value contains '**Microsoft Windows**', transform it to '**Windows**', else keep the existing value.

**Column Names:**

* **guest\_full\_name** (from)
* **guest\_os\_type** (to)

**Column Values:** (some of them)

* Microsoft Windows Server 2008 R2 (64-bit) **--> Transform to 'Windows'**
* CentOS 4/5/6/7 (64-bit)
* Red Hat Enterprise Linux 7 (64-bit)

{% hint style="info" %}
In the below syntax, @dm:map is used twice, 1st step is to clone the column to new column and 2nd step is to transform the values on cloned column.
{% endhint %}

```
data --> @dm:map from = 'guest_full_name' & to = 'guest_type' --> @dm:map attr = 'guest_type' & func = 'evaluate' & expr = "'Windows' if 'Microsoft Windows' in guest_type else guest_type"
```

![](/files/-MVKdoTrllFCGYrxgazw)

**Example 3:** Clone the Column (copy) & Transform the data with function '**evaluate**' (using multiple '**if**' and '**else**' conditions using a python expression)

Get the data from VMware vROps VM Summary tag (**\*vrops:vm\_summary**) which includes some of the below columns, **clone** the column '**guest\_full\_name**' to '**guest\_os\_type**' and transform the values (data) within the '**guest\_os\_type**' based on the existing value.

If column **guest\_os\_type's** value contains '**Microsoft Windows**', transform it to '**Windows**', else keep the existing value.

**Column Names:**

* **guest\_full\_name** (from)
* **guest\_os\_type** (to)

**Column Values:** (some of them)

* Microsoft Windows Server 2008 R2 (64-bit) **--> Transform to 'Windows'**
* CentOS 4/5/6/7 (64-bit) **--> Transform to 'Linux OS Opensource'**
* Red Hat Enterprise Linux 7 (64-bit) **--> Transform to 'Linux OS Commercial'**

```
data --> @dm:map from = 'guest_full_name' & to = 'guest_type' --> @dm:map attr = 'guest_type' & func = 'evaluate' & expr = "'Windows' if 'Microsoft Windows' in guest_type else 'Linux OS Opensource' if 'CentOS' in guest_type else 'Linux OS Commercial' if 'Red Hat Enterprise' in guest_type else 'Other OS'"
```

![](/files/-MVKgkHF5UYUq0QIxpNl)
