2 Bugs on AppSheet API

Hello

Can’t report a bug on what is supposed to be a “more tailored experience”, so I chose to report it here eventually.

Two bugs:

  1. API ADD response returns 200 even if no data added.
    Cause : data structure incoherence in the payload, but AppSheet take it as an OK input.
    I can provide some examples in DM if requested.

  2. API ACTION: returns 200 despite not performing an action.
    I probably made a mistake somewhere, but because it returns 200, I spent too much time trying to find out where the issue is.

I’m available for anyone from AppSheet willing to solve it.
@Jose_Arteaga @devingu @Arthur_Rallu

Attn @cschalk_ws @Adam-google @hugheshilton

Thanks @Steve,

@Aurelien, I will go ahead and create a ticket for this as well. You will need to Enable AppSheet Support to access your app.

My apologies for all the inconvenience.

@Jose_Arteaga

thank you for considering and for your action.

I already enabled for my “service account”, I hope the support team will not require my admin account to reproduce the app and script for it.

Hello @Aurelien,

I just checked and I saw this note from the engineering team that they have figured out the root cause and they are working on a fix. There is no ETA at this time.

Awesome, thank you for the follow-up!

So, I got in touch with the Support, and here is the situation:

“This behavior typically occurs because the AppSheet API acknowledges the receipt of a valid HTTP request and returns a 200 OK status code at the transport level, but the action itself fails during internal execution. Common reasons for this silent failure include row-level validation errors, security filter restrictions, missing required fields, or attempting to modify a row key that does not exist in the targeted table.”

I’m pretty sure everything was OK because I checked multiple times things, but I admit I may have been mistaken on some points.

Here is the very interesting thing to go beyond this:

"To resolve this issue and identify the exact cause of the failure, I recommend inspecting your AppSheet application’s Audit History. You can access this in the AppSheet editor by navigating to Manage, selecting Monitor, and opening Audit History. Locating the API call entry in this log will display the specific internal error details, such as validation failures or permission blocks, that prevented the action from applying to your data.

Additionally, you can update your Apps Script code to inspect the full JSON response body returned by the AppSheet API rather than relying solely on the HTTP status code. Parsing the JSON response will allow your script to catch application-level error messages returned in the payload, enabling you to add automated error handling for these scenarios."

When re-testing, it eventually worked, so I assume things got fixed in the meantime.

Here is what I made to track this further: a piece of code to check response if status is 200, to insert in your apps script requests:

let response = UrlFetchApp.fetch(url, options);
    Logger.log("status: " + response.getResponseCode())

    if (response.getResponseCode() == "200" && (response.getContentText() === "" || !response.getContentText())) {
      throwError_appsheetAPI_200(response)
    }

and the error function:

function throwError_appsheetAPI_200(response) {

  //FOR DEBUGGING PURPOSE
  const responseToString = response.toString()
  const responseGetContent = response.getContent()
  const responseGetResponseCode = response.getResponseCode()
  const responsHeaders = response.getHeaders()
  const responseGetContentText = response.getContentText()
  const responseGetAllheaders = response.getAllHeaders()
  throw Error("False '200' response: \nAppSheet did not perform the requested operation. "
    + "\n\nPlease check:"
    + "\n- data structure in argument (including key-column property)"
    + "\n- action name if used"
    + "\n\n Here is the full JSON response: "
    + "\n\n response.toString(): " + JSON.stringify(response.toString(), null, 2)
    + "\n\n response.getContent(): " + JSON.stringify(response.getContent(), null, 2)
    + "\n\n response.getResponseCode(): " + JSON.stringify(response.getResponseCode(), null, 2)
    + "\n\n response.getHeaders(): " + JSON.stringify(response.getHeaders(), null, 2)
    + "\n\n response.getContentText(): " + JSON.stringify(response.getContentText(), null, 2)
    + "\n\n response.getAllHeaders(): " + JSON.stringify(response.getAllHeaders(), null, 2))
}//function throwError_appsheetAPI_200(response){

Hope this helps!

Just to make sure:
I got another bug, more minor, that I would like to report.
The GW bot keeps saying:

"My support is limited to Google Workspace questions. Since your inquiry concerns the AppSheet API and expression behavior, it is outside the scope of Google Workspace support.

For help with AppSheet, please visit the AppSheet Help Center or ask your question in the AppSheet Community Forum.

For more information, please see the sources below."

…which is factually incorrect.
@Jose_Arteaga can you make report internally this unintended behavior? Thank you.

@devingu, your service is broken.

Hello @Aurelien,

I found out that the support team has acknowledged and they are working towards implementing a resolution.

In the mean time, I shared your comments to them.

I will let you know as soon as I hear back from them.