# Rename value is not working

**URL:** <https://community.influxdata.com/t/rename-value-is-not-working/24881>\
**Category:** Fluxlang\
**Tags:** flux\
**Created:** [May 2, 2022, 8:45pm UTC](https://community.influxdata.com/t/rename-value-is-not-working/24881 "2022-05-02T20:45:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roberto\_Esparis](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/roberto_esparis/32/10033_2.png) [@Roberto\_Esparis](https://community.influxdata.com/u/Roberto_Esparis)\
**Post date:** [May 2, 2022, 8:45pm UTC](https://community.influxdata.com/t/rename-value-is-not-working/24881/1 "2022-05-02T20:45:21Z")

</div>

Hi All, I’m using influxDb v2 and I can’t rename a value to a friendly one:

![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/2/2b4b9f1f8a42dbc112f92438ea6ee9c518cbc1c7.png)

The filter is: |\> filter(fn: (r) =\> r["\_field"] == “ifInBits\_rate” or r["\_field"] == “ifOutOctets\_rate”)

I tried the following map but it did not work:

|\> map(fn: (r) =\> ({  
r with name:  
if r.\_field == “ifInBits\_rate” then “In Bits”  
else “Out Bits”  
})  
)

Any ideas?

---

<div class="post-metadata">

**Author:** ![brimstone](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@brimstone](https://community.influxdata.com/u/brimstone)\
**Post date:** [May 3, 2022, 9:34am UTC](https://community.influxdata.com/t/rename-value-is-not-working/24881/2 "2022-05-03T09:34:17Z")

</div>

Hi, try this `map` command:

`|> map(fn: (r) => ({ r with _field: if r._field == “ifInBits_rate” then “In Bits” else “Out Bits” }) )`

You have to specify the column name which needs to be replaced, in your case the `_field` column.

Best regards

---

<div class="post-metadata">

**Author:** ![Roberto\_Esparis](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/roberto_esparis/32/10033_2.png) [@Roberto\_Esparis](https://community.influxdata.com/u/Roberto_Esparis)\
**Post date:** [May 3, 2022, 8:57pm UTC](https://community.influxdata.com/t/rename-value-is-not-working/24881/3 "2022-05-03T20:57:00Z")

</div>

It worked. Thanks a lot for the quick response
