How do I efficiently output to a non-contiguous range in Google Apps Script (GAS) -
i'm new google script, appreciate help!
here's data looks (3 non-contiguous records, 4 non-contiguous fields): https://docs.google.com/spreadsheets/d/18ffb2hlcfccihj7npmihzbuf47op2umdrtkfpytqowu/edit#gid=0
i have array of items , each item object contains 4 keys. want output google sheets in few setvalue requests possible. if can't in 1 call, makes logical sense output each item @ time.
my idea can create ranges fields 1 , 4 span entire column. can create ranges span entire item row. intersection between 2 range want output to, once have assembled array of 2 values.
or perhaps since assuming know rows/columns of each cell below, can return range , use union of ranges create mapping instead.
but there function intersection or union in gas? or better off outputting each cell 1 1?
thanks help!
there's no such function. it's either 1 one or contiguous cells.
but there's quite few tricks/alternatives might work you. sandy pointed in comment, contiguous range had required cells , set non-required ones blank or original values. has down side of not working formulas.
you pre-configured required cells simple formulas "pointing" continuous range. bulk update @ once.
if bulk setting required, grab values and formulas of wide range, , convert plain values equivalent formulas, e.g. abc
becomes ="abc"
, 1/1/2015
=date(2015,1,1)
(yes, it's cumbersome) , use setformulas set back, both original formulas , values converted formulas. making no actual content change in cells don't want , changing required ones, in 1 bulk operation.
anyway, these workarounds. stated in first sentence, it's not possible, period. want star this report in apps script issue tracker kind of vote feature , receive updates.
Comments
Post a Comment