I am trying to create an array or map linking 3 different sets of values using Google App Script. My three sets of values can be denoted as A, B, and C. I am thinking of using A as a key linking to a pair of values {B, C}. How do you implement this in Google App Script? Is there a better way to do this? Thank you for the help!
1 Answer
Here is my implementation:
var data = sheet.getDataRange().getValues();
var basic_details = {
"roll_number":data[12][2],
"first_name":data[13][2],
"last_name":data[14][2],
"gender":data[15][2],
"type":data[16][2]
};
var all_data = {
"search_for" : search_roll_num ,
"basic_details" : basic_details ,
};
var access_last_name = all_data.basic_details.last_name;
Here I am able to refer to values by their key name. Maybe this helps?
key valueon the Google Apps Script site, there are a lot of results that include those terms.