# Delegated Admin Extension: custom property not writing to app\_metadata

**URL:** <https://community.auth0.com/t/delegated-admin-extension-custom-property-not-writing-to-app-metadata/59380>\
**Category:** Get Help\
**Tags:** extensions, delegated-admin, settings\
**Created:** [March 13, 2021, 9:53pm UTC](https://community.auth0.com/t/delegated-admin-extension-custom-property-not-writing-to-app-metadata/59380 "2021-03-13T21:53:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brikofen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brikofen/32/28129_2.png) [@brikofen](https://community.auth0.com/u/brikofen)\
**Post date:** [March 13, 2021, 9:53pm UTC](https://community.auth0.com/t/delegated-admin-extension-custom-property-not-writing-to-app-metadata/59380/1 "2021-03-13T21:53:32Z")

</div>

I have the following Settings Query configured for my Delegated Admin Extension dashboard to try and configure the user’s app\_metadata.city property:

```
function(ctx, callback) {
  return callback(null, {
    connections: [ctx.request.user.identities[0].connection],
    dict: {
      title: ctx.request.user.identities[0].connection ? ctx.request.user.identities[0].connection + ' Management' : 'User Management Dashboard',
      menuName: ctx.request.user.name
    },
    userFields: [
        {
            "property": "app_metadata.city",
            "label": "City",
			"create": {
                "required": true,
                "type": "select",
				"component": "InputMultiCombo",
				"options": Array("Paris", "New York")
            },
			"edit": {
                "required": true,
                "type": "select",
				"component": "InputMultiCombo",
				"options": Array("Paris", "New York")
            }
        },
		{
            "property": "repeatPassword",
			"create": false,
			"edit": false
        }
    ]
  });
}

```

However when creating a new user and choosing the city field the value is not added to the users app\_metadata.city.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![brikofen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brikofen/32/28129_2.png) [@brikofen](https://community.auth0.com/u/brikofen)\
**Post date:** [March 13, 2021, 10:29pm UTC](https://community.auth0.com/t/delegated-admin-extension-custom-property-not-writing-to-app-metadata/59380/2 "2021-03-13T22:29:36Z")

</div>

Well found the solution eventually, it had to be included in a Write Hook, something like this:

```
function(ctx, callback) {
  var newProfile = {
    email: ctx.payload.email,
    password: ctx.payload.password,
    connection: ctx.payload.connection,
    app_metadata: {
      city: ctx.payload.city
    }
  };
  
  return callback(null, newProfile);
}

```

I also changed the property name to “city” in the Settings Query instead of the previous “app\_metadata.city”.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 15, 2021, 12:22pm UTC](https://community.auth0.com/t/delegated-admin-extension-custom-property-not-writing-to-app-metadata/59380/3 "2021-03-15T12:22:00Z")

</div>

Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 25, 2021, 10:20am UTC](https://community.auth0.com/t/delegated-admin-extension-custom-property-not-writing-to-app-metadata/59380/4 "2021-03-25T10:20:49Z")

</div>


