How can i update a single record from google sheets with a switch?

Yes, that is the general idea. The script uses the record index and tests the first item. You may want to change this to test your ID number.

You may also get some ideas from here:

Hello, I am new to this forum, I looked through a lot of tutorials, I like the TIMAI2 work the most, but I have a question if it is possible to update via the selection list.

If you have a look at my CRUDII guide, this shows how you can update an item in a google sheet from the index of the list in your AI2 app

1 Like

I looked as I wrote, I like the work, but when updating it shows the entire row and I need the last three columns from the selection list.

If you only want to edit specific cells, you will need more blocks in your app and more code in the google apps script to handle that. The method I show does indeed display the entire row and update the entire row. You do not necessarily have to display all the data in your app for editing....

Editing the entire poem doesn't bother me, it's extra. Ok, I will keep trying.

Hello again, I simplified your blocks only to the update option, i.e. btViewData starts the update but I can't cope with converting textbox10 to the value from the dropdown list. I had so many ideas that I'm already stupid.

It is not obvious from your screenshots what you are trying to achieve. Where is textbox10 ?

Show the blocks that relate to your screenshots, and annotate what must change to what.

this is your google sheet CRUDQ II textbox list

I am trying to replace the last item in the pick list and all the rest will be done by the self timer

If I understand correctly, you want to replace the value Oczekuje (in textbox10) with one of the three items shown in the list on the right Wybierz, Zamkniete, Otwarte ?

If so, use the AfterPicking event of your listview/listpicker to set the value of textbox10 with the selection

yes, I tried but changes in the sheet appeared after selecting the same option twice, I will try, maybe I made a mistake somewhere

I do not know how to thank you. Fresh look and a professional look. And I've already figured out trying to replace entire lists.

My mistake I had a pick list and a drop down list in the app. Thanks again, if I could, I would give you a hug

I'll get a surrogate hug from someone here :wink:

Please to hear you got it working!

1 Like

It is a different topic, but it is about the same project. Do I need to get another selection index after filtering the data.

I will add that it sorts well, but after the update it selects the shifted lines

Yes, if you use the built-in filter on a listview, a selection will return the index of the filtered items, not the original index (it is annoying!) You can overcome this by writing your own filter with a textbox and Taifun's textbox extension.

1 Like

was that what I was afraid of or something like that? blocks (1)

See attached an example custom filterbar for a listview, that returns the index from the original list after selection. This uses a clock instead of an extension.

CustomFilterBarListview.aia (15.4 KB)

filtering...
image

after listview selection...
image

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.