Is it possible to use this._id in the onRendered function for Template?

I open user data from list with sending data by controller, and it is well for helpers but undefined for onRendered function in the same Template. What is my error or misunderstanding?

supAdmController = RouteController.extend({
  data: function () {
    return Meteor.users.findOne({_id: this.params._id});  /
  },
...
Template.editUserBySuperAdm.helpers({
  userId(){ return this._id; },   //  HvWb6vqf2EsrbY2hb  - well done
...
Template.editUserBySuperAdm.onRendered(function () {
     let userId = this._id;        
        console.log( "userId = " + userId );       //  userId = undefined
....

Thank you for help!

let userId = this.data._id;
1 Like

Thank you! That works! :smile:

1 Like