0

I have created a Google Apps Script to import data from Database(RDS/AWS) to Google Spreadsheet. Then I created a trigger to execute the script, however, I keep getting connection errors. But it's completed successfully when I execute the specific method on Google Apps Script.

Now I want to know if it's because the requesting IP are different between when running by a trigger and hands. How can I know the requesting IP when I execute it with hands and also when the script's run automatically by a trigger?

Thank you.

Konomi
  • 1
  • 1
  • 1

3 Answers3

1

Something like this will works ( Calling an external API ),

function getIP() {
  var url = "http://api.ipify.org";
  var json = UrlFetchApp.fetch(url);
  Logger.log(json);
}
Isuru Dilshan
  • 719
  • 9
  • 18
0

You cannot know it.

You must check if the script is running too many times in a day, because some servers could block the access.

Mario Zamora
  • 109
  • 7
0

Based from this related thread, you cannot know the request IP in Google Apps Script. You can also log a request for this feature as stated in this link.

Check these links:

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59