Even if we are using JavaScript, We can not use JavaScript sessions in Airtable scripting. However, we can still get the current user's name, email, id, and profile pic URL from the session that Airtable offers to us. So, if you want to use active user's details, you can use airtable session. In this article, I will be going through Sessions in Airtable. In airtable, you do not set session variables but you can use them. So, First, install the scripting app in your base and copy-paste the below code into your app.
console.log(`User Name: ${session.currentUser.name}]`);
console.log(`User Email: ${session.currentUser.email}]`);
console.log(`User ID: ${session.currentUser.id}]`);
console.log(`User Profile pic URL: ${session.currentUser.profilePicUrl}]`);
In the above code, we never set the current user's email, name, id, or profile pic URL data, but we can still use them. The syntax is very simple to use Airtable session variables. you can access it easily as shown in the above code. When you will run the above code in your scripting app, you will get your details. Because you are the active user now. You will get similar results to what I have shown you in the below image.
Now, you can easily use this data in your script. That's it for this lesson. Stay connected for more. Feel free to contact me for Airtable consulting services by CLICKING HERE.