I have an issue where a function that returns a value is not being pulled through in another function. Here is my code

```js
public _getProfileToUpdate() {
  return {
    corporateId: this.storeService.setStoreData().profile.preferred_username[1],
    id: this.storeService.setStoreData().profile.sub,
    firstName: this.userFormGroup.controls.firstName.value,
    lastName: this.userFormGroup.controls.lastName.value,
    email: this.userFormGroup.controls.email.value,
    mobile: this.userFormGroup.controls.mobile.value,
    workNumber: this.userFormGroup.controls.workNumber.value,
    roleId: this.sortRoleId()
  };
}

sortRoleId() {
  this._contentService._getRoles().subscribe((resp) => {
    const search = this.storeService.setStoreData().profile.role;
    const index = Object.values(resp.roles).indexOf(search);
    const result = Object.keys(resp.roles)[index];
    return result;
  })
}

```

So there is a "result" value that I am trying to send to the "roleId" value in the other function but it is showing as undefined.