# Getting joined data for widget scope

**URL:** https://meta.discourse.org/t/getting-joined-data-for-widget-scope/42264
**Category:** Development
**Created:** [2016年四月8日 22:00 UTC](https://meta.discourse.org/t/getting-joined-data-for-widget-scope/42264 "2016-04-08T22:00:01Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![stevenpslade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stevenpslade/32/53550_2.png) [@stevenpslade](https://meta.discourse.org/u/stevenpslade)
#### Post date: [2016年四月28日 20:11 UTC](https://meta.discourse.org/t/getting-joined-data-for-widget-scope/42264/4 "2016-04-28T20:11:56Z")

</div>

In using the staff notes plugin for reference, I have tried to make a custom field available to the `post-name` widget by doing the following:

In `plugin.rb`:

```
after_initialize do
  require_dependency 'user'
  whitelist_staff_user_custom_field("myCustomField")
end

```

In initializer:

```
import { withPluginApi } from 'discourse/lib/plugin-api';

export default {
  name: "alt-topic-initializer",

  initialize: function(container) {

    withPluginApi('0.2', api => {

      api.decorateWidget('poster-name:after', dec => {
        console.log(dec.attrs.userCustomFields);
      });

    });
 });

```

The result of my `console.log` is `undefined`.

I have tried whitelisting the custom field in Discourse site settings as well.

---

_[View the full topic](https://meta.discourse.org/t/getting-joined-data-for-widget-scope/42264)._
