Check if the link is active, if not, go to the next one

Hi guys
I have a question. I'm sorry for the English. I'm using Google Translator.
I made an app that was working normally. I type in a number, and it searches for the corresponding information for that number in a spreadsheet with the shared link in Google Drive. He searches for the information through the link in the csv spreadsheet.

My problem is that the Google Spreadsheet link has stopped working. It just doesn't open anymore. I can replace it with another one by updating the app that will work again. But I want to do something better, if the same mistake occurs in the future. I thought about putting several different links on the same spreadsheet and building with the following logic.
If link 1 doesn't exist, then look for link 2. If 2 doesn't exist, look for link 3. If 3 doesn't exist, look for link 4 etc.


But I don't know how to test the link. I have tried several tests, but all have failed. Can someone help me?
I tried the Web component, but I don't know if my test (If) is correct.

I'm also not sure which component to use in the variable that will receive the result of the Web component with the correct link.
blocks(2)

I thank you in advance for any help I receive.

1 Like

Your block color indicates you are using a different AI2 distro, so don't expect much in the way of specific blocks help here.

In general, an if/then tree can't handle asynchronous operations that take time and require events.

The solution is to declare a temporary queue of URLs to try, copied of a permanent list. Each time you get an error, delete item 1 and issue a single retry against the new item 1.

Let the queue do the work for you, no loop and no if/then tree.

P.S. My recent experience with Google Sheets errors included basic communications errors in my emulator setup timing, and sharing errors. There is also the possibility of Google throttling over use of a free account. It might not be the sheet, it might be you or your connection.

I would be more interested in figuring out why/if your spreadsheet link stopped working in the first place?

1 Like

Thanks for the quick response.
But how would I do that? I don't know which blocks to use.

It was not an app error. This is a Google Sheets issue. I contacted, but I was unsuccessful in support.

Add a Notifier to show the 4 values in the event, so you can respond accordingly.

and you couldn't even open the sheet through Drive ?

Excuse me. I'm a beginner. I really appreciate the help, but I still don't quite understand what needs to be done. Could you explain in more detail?

So I don't use the Web component and If, Else. I didn't understand how to use Notifier to show the 4 values in the event.

1 Like

I did not make it. This is the message that appears on the drive:

The file could not be opened. Try to refresh the page.

It's been like this for days. Other drive links open. But not on this spreadsheet. The link is shared to the public. No changes were made. It just stopped working.

1 Like

Care to share the link, that way we can check it not "you"....

Yes of course. The end of the URL has been changed to convert to CSV. It had been running for 6 months and then stopped. The link in the app is this.
https://docs.google.com/spreadsheets/d/1Vdw57vehS27gyI3O0SDev33w-n8OGwdb/gviz/tq?tqx=out:csv&tq=

The original link, with no changes to CSV, is this:
https://docs.google.com/spreadsheets/u/2/d/1Vdw57vehS27gyI3O0SDev33w-n8OGwdb/edit?usp=drive_web&ouid=102359331708761198287&dls=true

1 Like

I got a Google error trying to use that URL.

I tried clipping off the gviz stuff at the end, to see if that helped. No.

Try another way to get to the spreadsheet, by navigating your Google Drive folders from your Google Drive folder root in your web browser. Maybe the sheet has moved?

No response here either - console says error code 512 (which is unassigned according to http codes listing) - must be a special google thing.

Any way to contact the owner ?

What are these other spreadsheets, do they have the same (updating) data ?

I can download the spreadsheet to the drive and use it. I am the owner of the spreadsheet. But the shared link inside the app has stopped working, and this is the problem. And google says to hope it can work again. But I've seen people with this problem in the Google community a year ago and haven't come back. So I need to update the app with a new spreadsheet link that will have access to the information through the app again.
But I wouldn't want to risk the new link stop working again. So I would like to put several links in the app, so that if the first one stops working (as it happened with this one), look for the information in the next link.
In the other links there would be only copies of the same spreadsheet.

1 Like

:confused:

OK, let us work on your idea of checking spreadsheets.....

1 Like

Something like this should work for you

1 Like

duplicate

@Welison_Dias next time please first choose the builder you like to use and then ask only in the corresponding community… thank you
the builders get more and more different and an answer in one community might not be the correct answer for the other community
also you are wasting other people’s time… you don’t want that, do you?

Taifun

1 Like

Excuse me. It was not my intention to offend. Please do not close the topic. The app has stopped working and I urgently need to fix the problem. In desperation I asked on both forums to get the answer right away. I didn't know it was a big problem. It will not be repeated.

1 Like

A more complete example

1 Like

Thank you very, very much! It was this logic that I needed !!!!!!
To finish now, just one more thing is missing. I need to put the tested link that is active in the "initialize global" component. The current logic of my app is to do the search on the link that is in this variable.
How do I feed this variable with the active link that returns from Web1?

I tried it that way, but I couldn't.
Sem título

1 Like