title: Sequelize: how to pass findAll result as Model.create value
body: <p>I'm trying to insert an entry into table &quot;Message&quot; by passing an ID from table &quot;Users&quot; to use as an entry value but I'm getting a &quot;val.replace is not a function error&quot;. Here is my code:</p>
  <pre><code>Message.create({
    userId:
      Users.findAll({
        where: { username: &quot;sam123&quot; },
        attributes: ['id'],
        plain: true
      }).then((result) =&gt; {
        console.log(result.id)
        return result.id
      }),
    roomname: 'lobby',
    message: 'testing'
  })
  </code></pre>
  <p>My console log is returning the correct ID number but it is not passing that number to &quot;userId&quot;.</p>