Google apps script IP Address problems

Viewed 25

this is the function I am using

function getIPforApp() {
  var url = "http://api.ipify.org";
  var rtn = UrlFetchApp.fetch(url);
  Logger.log('this is rtn : '+ rtn);
  return (rtn);  

'

if I run this from the script editor IP in log is : my ip which is perfect XX.xxx.44.166

however when I run it from a sheet

IP in log is : 107.178.195.39 or IP in Log is : 35.243.23.187

If this is the wrong approach can anyone point me it the right direction PLEASE

0 Answers
Related