Node.js - Pass Session Variables to a SQL Server function call

157
May 04, 2018, at 10:48 AM

In a MS Teams BOT I have working dialog code to ask a series of questions and return the formatted response back to the user in a session like so:

session.send(`Details: <br/>Question1: ${session.dialogData.Question1}   <br/>Question2: ${session.dialogData.Question2} <br/>Question3: ${session.dialogData.Question3}`);

So I know the values I need are in the session variables. Now I want to pass the session variables to an SQL insert function (executeStatement):

    var session_username = session.dialogData.username
    var session_yesterday = session.dialogData.yesterday
    var session_today = session.dialogData.today
    var session_obstacles = session.dialogData.obstacles
    executeStatement(session_username, session_yesterday, session_today, session_obstacles)

I can pass strings and the function works fine. But when I try to pass the session variables like above or just passing session.dialogData.yesterday for instance, straight into the function all of the code runs fine - no errors are thrown - but the session variables are not inserted and 0 rows are returned.

What is the proper way to pass a session variable? Google has not been kind in this regard. :)

Thank you in advance...

READ ALSO
NodeJS posting data with sequelize

NodeJS posting data with sequelize

I am working on a project for a pretend library database and website interfaceRight now only 2 of the 4 new loan form inputs are being passed to the req

142
How would I use the return data from a controller as EJS data?

How would I use the return data from a controller as EJS data?

I have a Nodejs application in development which tries to get a list of clients

132
NodeJS Express 4 Classes and Middleware

NodeJS Express 4 Classes and Middleware

I am having the following problem with NodeJS (89

177
How to render Boostrap templates using with handlebarsjs

How to render Boostrap templates using with handlebarsjs

Hi There i'm trying to render a bootstrap template with handlebars (i'm using Express as a server), and it just doesn't render properly, the carousel slider and the Navbar logo are not rendered at all

149