# Getting user profile custom field via JS

**URL:** <https://meta.discourse.org/t/getting-user-profile-custom-field-via-js/32257>\
**Category:** Feature\
**Created:** [August 18, 2015, 5:08pm UTC](https://meta.discourse.org/t/getting-user-profile-custom-field-via-js/32257 "2015-08-18T17:08:54Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![dleung](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dleung](https://meta.discourse.org/u/dleung)\
**Post date:** [August 18, 2015, 5:08pm UTC](https://meta.discourse.org/t/getting-user-profile-custom-field-via-js/32257/1 "2015-08-18T17:08:54Z")

</div>

Hi,

I’m wondering if it is possible to retrieve user profile custom fields in our customized header using something like this:

```javascript
$.ajax("/session/current").then(function (json) { 
    console.log(json.custom.user_field_4);
}

```

What would be the correct syntax?  
Thanks!

---

_[View the full topic](https://meta.discourse.org/t/getting-user-profile-custom-field-via-js/32257)._
