Make an update with spread sheet taken from a listview

Dear community,

I have a wire issue, let me tell you, I took information from an spreadsheet using gviz query in order to make filters and that works fine



and then when I try to make un update

that is wire because the this is only possible to make the update for the first row and that is it.



by chance does any body knows why is working like this and could plese let me know how could I fix it please.

and that is even wirer because I realize that I can make some obdates but not all ,

what the code make some updates and some not

something important I use two URL one to take the info from the spreadsheet and another to take make the updates and I guess the app is cofuse, but I am not sure

By chance do I need to make script code for SQL use Json and to make It possible or Is there a mixtake with codes ?

do you know way ?

You can achieve it in simple manner by adding extra col in spteadsheet for row number.. While calling qviz call this col too amd put it in a separae variable.. So every time you call qviz suppose if data comes from ranfom data it will be difficult to take row number but by using this you can take the required row and put the row number in ROWID in script url


I feel this will be the easiest way but may be someother too could exist.

Hi dear @Spicy_Topics nice to know about you.

So that means that I need to do something like this.


And then should I make

Select A, C, I where B = 'selection ' ?

And then in the Bloks put

List Item
Index (1)

Something like this ?

Almost but don't use 1,3,9 as index, instead use 1,2,3.. Because Your response content will have three items only. Index depends upon how many columns you are calling and not index of the column

Ok , I Will doi It , and then I go back


I understand a little more, just a question.


DATA are colum and ROWID are the row.

but in my blocks

I have Data as an emplty list and ROWID as text

to be honest I took this code from Metric Rat

and I struggle to understand how to manage make the change

@Spicy_Topics I did your sugestion but It doesnot works

e.parameter.DATA is all the data for the row (one value for each column)
e.parameter.ROWID is the index of the data(row values) in your AI2 list which helps to define the correct row on the spreadsheet

Yes as said by Tim,
DATA= Items to be added in ROW,
ROWID is the index number of the row to get this only i have told you to add extra colum to take exact row

Else share a demo aia file, we will fix it..

haaa ok I get it, and how could I make that this


Is taken from the colum I and the code were able to take the selected row from the list view ?

and how to make update from a different colum ?

I did

image E, F, G, H, I WHERE A =

but is still not working

I guess because it has something in the script

else if ( e.parameter.FN == 'Update' ) {
var data = JSON.parse('[' + e.parameter.DATA + ']');
sh.getRange(parseInt(e.parameter.ROWID) + 1,1,1,data[0].length).setValues(data);
return ContentService.createTextOutput("Record Updated");

Actually there is no connection with script.. It works well. The problem is how do you set blocks for the updation is matters..

Do one thing, get listview items all those items then click for update, then click on all the global variable or url to show us the final url what are sending from app

No reason why this will not work. If you get the ROWID value from Column I, you use this to set the value of e.parameter.ROWID.

[EDIT] for the google apps script to work, you may need [ROWID -1], because the dataRange values json array starts at 0.

Show us the value of globalROWID and globalDATA that you are sending from the app

ROWID must be a integer..

Imagine in list view if 5 items(5 different col) are there and you are clicking 2nd item and want to update mean, the global data must be every second item from the response content of query result and nake them into list

ROWID must be select the 5the item of response content (which contains the integer)

SMO.aia (234.3 KB)
here the AI2

screen name?

so something like this ?


problem is here..


here you converted list into different format . so need to change into list item

@Arturo The Question is, Which data you want to update? Some items are showing inlist view, want to send all the items? How can you edit it? No need to edit? If no need mean then why do you wanna update?

:thinking: wow and how could I do it ?

also it doesnot return any headers so no need to remove index 1 from response content..

Easily can do it.. The suggestion is.. make four text boxes and list view

Let List view to show any one col obtained from query result.. And on clciking or selecting the item, its relevant info let we make it show in tex boxes.. Once editing over and hit update button mean that specific row will let to update