Here is an example process for iterating through a particular column on a chosen worksheet using Office scripts:
getWorksheet
function.let sheet = context.workbook.worksheets.getItem("Sheet1");
getRange
function.let range = sheet.getRange("A:A");
getValues
function.let values = range.getValues();
for(let i=0; i<values.length; i++){
let item = values[i];
// do something with the item
}
for(let i=0; i<values.length; i++){
let item = values[i];
sheet.getRange("B" + (i+1)).setValue(item * 2);
}
for(let i=0; i<values.length; i++){
let item = values[i];
if(item > 10){
sheet.getRange("B" + (i+1)).setValue("High");
} else {
sheet.getRange("B" + (i+1)).setValue("Low");
}
}
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-06-26 16:11:51 +0000
Seen: 8 times
Last updated: Jun 26 '23
How can the approval status of a SharePoint List item be updated using Power Automate?
How can I use flexbox to achieve an even amount of empty space at either end?
How can the last item be displayed fully while only half of the right item is shown in slick slider?
What does it mean to select an item on the display by clicking it?
What is the process for removing an item from the Laravel session?
How to obtain a Null value in combo boxes?
What is the process for selecting items in a list that appear only once?
How can I send an array of objects to a controller in ASP.NET 6 (Core)?