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 Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,465 questions
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 21,621 Reputation points Microsoft Employee
    2020-08-21T20:55:39.723+00:00

    Hi, have you tried using Asynchronous callbacks?

    0 comments No comments