Need help to make button reading url from google sheet

Hopefully....

but every thing is okay already is fine all data reading

Problem solved ?

no still not working

What did you mean by this then ?

im talking about my code

function doGet(e) {
return ManageSheet(e);
}

function doPost(e) {
return ManageSheet(e);
}

function ManageSheet(e) {

//READ ALL RECORDS
if ( e.parameter.func == "ReadAll") {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[0];
var rg = sh.getDataRange().getValues();
var outString = '';
for(var row=0 ; row<rg.length ; ++row){
outString += rg[row].join(',') + '\n';
}
return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
}

//READ SINGLE RECORD
else if ( e.parameter.func == "ReadRecord") {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[0];
var rg = sh.getDataRange().getValues();
var outString = '';
outString += rg[parseInt(e.parameter.id)].join(',');
return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
}
}

If you keep your blocks as they are, and the sheet in the spreadsheet with your data is called "Sheet1" to match what it says in the blocks (if not change it) then you need to change your script to this:

function doGet(e) {
return ManageSheet(e);
}

function doPost(e) {
return ManageSheet(e);
}

function ManageSheet(e) {

//READ ALL RECORDS
if ( e.parameter.func == "ReadAll") {
var SS = e.parameter.ID;
var ss = SpreadsheetApp.openById(SS);
var SH = e.parameter.SH;
var sh = ss.getSheetByName(SH);
var rg = sh.getDataRange().getValues();
var outString = '';
for(var row=0 ; row<rg.length ; ++row){
outString += rg[row].join(',') + '\n';
}
return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
}

//READ SINGLE RECORD
else if ( e.parameter.func == "ReadRecord") {
var SS = e.parameter.ID;
var ss = SpreadsheetApp.openById(SS);
var SH = e.parameter.SH;
var sh = ss.getSheetByName(SH);
var rg = sh.getDataRange().getValues();
var outString = '';
outString += rg[parseInt(e.parameter.id)].join(',');
return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
}
}

Also ensure you update your script correctly:

1 Open the script project
2 Go to Publish
3 Deploy as Web App
4 Project version: - select New from the dropdown
5 Execute the app as: your google account address (email)
6 Who has access to the app: Anyone, even anonymous
7 Press the Update button

You have to do this EVERY TIME you change your script

:sweat: :sweat: :sweat: :sweat:

according to your error message, you are using a list from csv table block in the Web.GotText event
never blindly assume, that a csv table will be returned...
you might want to display the response content in a label to find out, what is going on
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

So I gave you my aia and asked if it could be modified
and if you need mt Email will give you

sorry, I will not fix your monster project... it looks like you have to do this yourself...

to use 18 screens is a bad idea, see also tip 1 here

what you could try is this probably simpler approach, which uses the Google Visualization API App Inventor Tutorials and Examples: Google Spreadsheet Database | Pura Vida Apps

Taifun

I deleted all the assets in your aia, then ran the aia in my companion from Screen: Video_Target

Web1.Get returned a number list to the listview

Selecting and item from the listview filled the labels on the right with data from Web2.Get

The video in the video link button played.

This only worked for the first item in the listview: 344201318

The other item caused an error, probably because the data on the spreadsheet is incomplete.

My work here is done :wink:

yes i didn't add video link only one i put in google sheet
already im still trying :joy:
which code you use there

Now I'm adding more you have to try again, but I have to add different links until you notice results for each option

As I said...

I put various links in Google Sheet
Can you send a aia file after modification?

I forgot to add that you need to change the url for the activity starter - previously mentioned this but you have not changed it.

Here is the stripped aia project that works for me

BoomAgency_stripped.aia (272.6 KB)

I did it with a different idea :grin:
the Label is un Visible and the bouton getting ulr from label

hello i use the readall func and every thing work well but when the record reach 7 rows its start to miss the last row any idea

machine