How to retrieve a variable from a script to put in another script

ahmed haouchette 1 Reputation point
2020-08-20T14:10:02.253+00:00

Hello I have a little problem with my project which uses the Microsoft Graph API. I need to implement a REST API that retrieves users' shared calendar from an Azure AD. I use NodeJS and express for this.

Here is the handlebars:

19113-fichier-hbs.jpg

I implemented a script (script.js) which retrieves the username of the users (the username corresponds to their email address):

19167-script-js.jpg

Now that I get the email address of the person I want to consult his calendar I would have to pass this variable in a function of another script (graph.js):

19089-graph-js.jpg

I would like instead of the giveUser () function in the getSharedCalend to put the email address of the person who has been checked in the .hbs
Thank you in advance for your help.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-08-21T20:55:39.723+00:00

    Hi, have you tried using Asynchronous callbacks?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.