Spreadsheet conversion from 'int' to 'String' is ambiguous

I'm having trouble with the spreadsheet
conversion from 'int' to 'String' is ambiguous

String kondisiNow = "Rain";
sendData(kondisiNow);

What does this have to do with a spreadsheet ?
What does it have to,do with a conversion from 'int' to 'String'

I'm having trouble with the spreadsheet

String kondisiNow = "Rain";
sendData(kondisiNow);

I want to send data in esp32 to a spreadsheet but the data is in string form and the problem is that sendData cannot read strings

void loop() {
  String kondisiNow = "Hujan";
  sendData(kondisiNow);
}

// Subroutine for sending data to Google Sheets
void sendData(String kondisiNow) {
  Serial.println("==========");
  Serial.print("connecting to ");
  Serial.println(host);
  
  //----------------------------------------Connect to Google host
  if (!client.connect(host, httpsPort)) {
    Serial.println("connection failed");
    return;
  }
  //----------------------------------------

  //----------------------------------------Processing data and sending data
  String string_kondisiNowid =  kondisiNow;

  String url = "/macros/s/" + GAS_ID + "/exec?kondisiNowid=" + string_kondisiNowid;
  
  Serial.print("requesting URL: ");
  Serial.println(url);

  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
         "Host: " + host + "\r\n" +
         "User-Agent: ESP32\r\n" +
         "Connection: close\r\n\r\n");

  Serial.println("request sent");
  //----------------------------------------

  //----------------------------------------Checking if the data was sent successfully or not
  while (client.connected()) {
    String line = client.readStringUntil('\n');
    if (line == "\r") {
      Serial.println("headers received");
      break;
    }
  }
  String line = client.readStringUntil('\n');
  if (line.startsWith("{\"state\":\"success\"")) {
    Serial.println("esp32/Arduino CI successful!");
  } else {
    Serial.println("esp32/Arduino CI has failed");
  }
  Serial.print("reply was : ");
  Serial.println(line);
  Serial.println("closing connection");
  Serial.println("==========");
  Serial.println();
  //----------------------------------------
}

that's probably not from that snippet (in the future don't post snippets (Snippets R Us!))

post the full sketch, what you posted is not complete and can't be tested

you could also copy and paste the output of the compilation (don't post an image, post text within code tags)

may be the issue is with

  String url = "/macros/s/" + GAS_ID + "/exec?kondisiNowid=" + string_kondisiNowid;

This is obviously not true, the sendData function has a string parameter:

void sendData(String kondisiNow) {

The issue is not in this, but somewhere else.
Try to describe the problem correctly.

I recommend that you don't use someone else's code that you don't understand. Start with a simpler project

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